@@ -240,7 +240,7 @@ The success listener is called with an array of instances if the query succeeds.
...
@@ -240,7 +240,7 @@ The success listener is called with an array of instances if the query succeeds.
| [options.limit] | Number | |
| [options.limit] | Number | |
| [options.offset] | Number | |
| [options.offset] | Number | |
| [options.transaction] | Transaction | Transaction to run query under |
| [options.transaction] | Transaction | Transaction to run query under |
| [options.lock] | String | Object | Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model locks with joins. See [transaction.LOCK for an example](api/transaction#lock) |
| [options.lock] | String | Object | Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model locks with joins. See [transaction.LOCK for an example](transaction#lock) |
| [options.raw] | Boolean | Return raw result. See sequelize.query for more information. |
| [options.raw] | Boolean | Return raw result. See sequelize.query for more information. |
| [options.logging=false] | Function | A function that gets executed while running the query to log the sql. |
| [options.logging=false] | Function | A function that gets executed while running the query to log the sql. |
@@ -72,7 +72,7 @@ The comment option can also be used on a table, see [model configuration][0]
...
@@ -72,7 +72,7 @@ The comment option can also be used on a table, see [model configuration][0]
## Data types
## Data types
Below are some of the datatypes supported by sequelize. For a full and updated list, see [DataTypes](api/datatypes).
Below are some of the datatypes supported by sequelize. For a full and updated list, see [DataTypes](../api/datatypes).
```js
```js
Sequelize.STRING// VARCHAR(255)
Sequelize.STRING// VARCHAR(255)
...
@@ -212,7 +212,7 @@ Employee
...
@@ -212,7 +212,7 @@ Employee
### Defining as part of the model options
### Defining as part of the model options
Below is an example of defining the getters and setters in the model options. The `fullName` getter, is an example of how you can define pseudo properties on your models - attributes which are not actually part of your database schema. In fact, pseudo properties can be defined in two ways: using model getters, or by using a column with the [`VIRTUAL` datatype](api/datatypes#virtual). Virtual datatypes can have validations, while getters for virtual attributes cannot.
Below is an example of defining the getters and setters in the model options. The `fullName` getter, is an example of how you can define pseudo properties on your models - attributes which are not actually part of your database schema. In fact, pseudo properties can be defined in two ways: using model getters, or by using a column with the [`VIRTUAL` datatype](../api/datatypes#virtual). Virtual datatypes can have validations, while getters for virtual attributes cannot.
Note that the `this.firstname` and `this.lastname` references in the `fullName` getter function will trigger a call to the respective getter functions. If you do not want that then use the `getDataValue()` method to access the raw value (see below).
Note that the `this.firstname` and `this.lastname` references in the `fullName` getter function will trigger a call to the respective getter functions. If you do not want that then use the `getDataValue()` method to access the raw value (see below).
* @param {Transaction} [options.transaction] Transaction to run query under
* @param {Transaction} [options.transaction] Transaction to run query under
* @param {String|Object} [options.lock] Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model locks with joins. See [transaction.LOCK for an example](api/transaction#lock)
* @param {String|Object} [options.lock] Lock the selected rows. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. Postgres also supports transaction.LOCK.KEY_SHARE, transaction.LOCK.NO_KEY_UPDATE and specific model locks with joins. See [transaction.LOCK for an example](transaction#lock)
* @param {Boolean} [options.raw] Return raw result. See sequelize.query for more information.
* @param {Boolean} [options.raw] Return raw result. See sequelize.query for more information.
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.