// similar for sync: you can define this to always force sync for models
sync:{force:true},
// sync after each association (see below). If set to false, you need to sync manually after setting all associations. Default: true
syncOnAssociation:true,
// use pooling in order to reduce db connection overload and to increase speed
// currently only for mysql and postgresql (since v1.5.0)
pool:{max:5,idle:30},
// language is used to determine how to translate words into singular or plural form based on the [lingo project](https://github.com/visionmedia/lingo)
// options are: en [default], es
language:'en',
// isolation level of each transaction. Defaults to REPEATABLE_READ
// options are:
// READ_UNCOMMITTED
// READ_COMMITTED
// REPEATABLE_READ
// SERIALIZABLE
// pool configuration used to pool database connections
Sequelize supports read replication, i.e. having multiple servers that you can connect to when you want to do a SELECT query. When you do read replication, you specify one or more servers to act as read replicas, and one server to act as the write master, which handles all writes and updates and propagates them to the replicas (note that the actual replication process is **not** handled by Sequelize, but should be set up in MySql).
Sequelize supports read replication, i.e. having multiple servers that you can connect to when you want to do a SELECT query. When you do read replication, you specify one or more servers to act as read replicas, and one server to act as the write master, which handles all writes and updates and propagates them to the replicas (note that the actual replication process is **not** handled by Sequelize, but should be set up by database backend).
If you have any general settings that apply to all replicas you do not need to provide them for each instance. In the code above, database name and port is propagated to all replicas. The same will happen for user and password, if you leave them out for any of the replicas. Each replica has the following options:`host`,`port`,`username`,`password`,`database`.
Sequelize uses a pool to manage connections to your replicas. The default options are:
```js
{
max:5,
min:0,
idle:10000,
acquire:10000,
evict:60000,
handleDisconnects:true
}
```
Sequelize uses a pool to manage connections to your replicas. Internally Sequelize will maintain two pools created using `pool` configuration.
If you want to modify these, you can pass pool as an options when instantiating Sequelize, as shown above.
**Note:** Read replication only works for MySQL at the moment!
Each `write` or `useMaster: true` query will use write pool. For `SELECT` read pool will be used. Read replica are switched using a basic round robin scheduling.
## Dialects
With the release of Sequelize`1.6.0`, the library got independent from specific dialects. This means, that you'll have to add the respective connector library to your project yourself. Version 1.7.0 stable has been released in bundles with the connector libraries (sequelize-mysql, sequelize-postgres etc.) but these bundles are not maintained, and will not be released for 2.0.0 upwards.
With the release of Sequelize`1.6.0`, the library got independent from specific dialects. This means, that you'll have to add the respective connector library to your project yourself.
### MySQL
...
...
@@ -204,7 +193,7 @@ const sequelize = new Sequelize('sqlite:relativePath/dbname.db')
### PostgreSQL
The library for PostgreSQL is`pg@^5.0.0 || ^6.0.0 || ^7.0.0` You'll just need to define the dialect:
The library for PostgreSQL is`pg@^5.0.0 || ^6.0.0` You'll just need to define the dialect: