Sequelize Class
Main class of the project.
Constructor
Sequelize
-
database
-
username
-
[password=null]
-
[options={}]
Parameters:
-
database
StringThe name of the database.
-
username
StringThe username which is used to authenticate against the database.
-
[password=null]
String optionalThe password which is used to authenticate against the database.
-
[options={}]
Object optionalAn object with options.
-
[dialect='mysql']
String optionalThe dialect of the relational database.
-
[host='localhost']
String optionalThe host of the relational database.
-
[port=3306]
Integer optionalThe port of the relational database.
-
[protocol='tcp']
String optionalThe protocol of the relational database.
-
[define={}]
Object optionalOptions, which shall be default for every model definition.
-
[query={}]
Object optionalI have absolutely no idea.
-
[sync={}]
Object optionalOptions, which shall be default for every
sync
call. -
[logging=console.log]
Function optionalA function that gets executed everytime Sequelize would log something.
-
[omitNull=false]
Boolean optionalA flag that defines if null values should be passed to SQL queries or not.
-
[queue=true]
Boolean optionalI have absolutely no idea.
-
[native=false]
Boolean optionalA flag that defines if native library shall be used or not.
-
[replication=false]
Boolean optionalI have absolutely no idea.
-
[pool={}]
Object optionalSomething.
-
Example:
// without password and options
var sequelize = new Sequelize('database', 'username')
// without options
var sequelize = new Sequelize('database', 'username', 'password')
// without password / with blank password
var sequelize = new Sequelize('database', 'username', null, {})
// with password and options
var sequelize = new Sequelize('my_database', 'john', 'doe', {})
Item Index
Methods
Methods
getMigrator
-
[options={}]
-
[force=false]
Returns an instance (singleton) of Migrator.
Parameters:
-
[options={}]
Object optionalSome options
-
[force=false]
Boolean optionalA flag that defines if the migrator should get instantiated or not.
Returns:
getQueryInterface
()
QueryInterface
Returns an instance of QueryInterface.