Created
November 3, 2013 15:13
-
-
Save clone1018/7291265 to your computer and use it in GitHub Desktop.
/// <reference path="../.ts/sequelize.d.ts" />
import Sequelize = require("sequelize");
db = new Sequelize(dbConfig.database, dbConfig.username, dbConfig.password);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface DatabaseOptions { | |
host?:string; | |
port?:number; | |
protocol?:any; | |
logging?:any; | |
maxConcurrentQueries?:number; | |
dialect?:string; | |
storage?:string; | |
omitNull?:boolean; | |
native?:boolean; | |
define?: { | |
underscored?:boolean; | |
freezeTableName?:boolean; | |
syncOnAssociation?:boolean; | |
charset?:string; | |
collate?:string; | |
clasMethods?:any; | |
instanceMethods?:any; | |
timetamps?:boolean; | |
}; | |
sync?: { | |
force?:boolean; | |
}; | |
syncOnAssociation?:boolean; | |
pool?: { | |
maxConnections?:number; | |
maxIdleTime?:number; | |
}; | |
language?:string; | |
} | |
interface Model { | |
sync(options?:{ | |
force?:boolean; | |
}); | |
drop(); | |
build(options?:any); | |
find(id:number); | |
find(options?:any); | |
findOrCreate(options?:any); | |
create(options?:any); | |
findAll(); | |
count(); | |
max(attribute:string); | |
min(attribute:string); | |
save(); | |
success(cb?:any); | |
destroy(options?:any); | |
belongsTo(model:Model); | |
hasOne(model:Model, options?:any); | |
hasMany(model:Model, options?:any); | |
} | |
declare module "sequelize" {} | |
interface Sequelize { | |
(database:string, username:string, password:string, options?:DatabaseOptions): Sequelize; | |
define(model:string, options?:any):Model; | |
query(query:string, calee?:any, options?:any, replacements?:any); | |
} | |
declare var Sequelize: Sequelize; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface DatabaseOptions { | |
host?:string; | |
port?:number; | |
protocol?:any; | |
logging?:any; | |
maxConcurrentQueries?:number; | |
dialect?:string; | |
storage?:string; | |
omitNull?:boolean; | |
native?:boolean; | |
define?: { | |
underscored?:boolean; | |
freezeTableName?:boolean; | |
syncOnAssociation?:boolean; | |
charset?:string; | |
collate?:string; | |
clasMethods?:any; | |
instanceMethods?:any; | |
timetamps?:boolean; | |
}; | |
sync?: { | |
force?:boolean; | |
}; | |
syncOnAssociation?:boolean; | |
pool?: { | |
maxConnections?:number; | |
maxIdleTime?:number; | |
}; | |
language?:string; | |
} | |
declare module "sequelize" {} | |
declare class Sequelize<T> { | |
constructor(database:string, username:string, password:string, options?:DatabaseOptions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment