不要怂,就是干,撸起袖子干!

Commit 66ba1666 by Cao Jiannan Committed by Jan Aagaard Meier

[ci skip] Add missing option description for returning and silent (#6146)

* Change mapToModel as Boolean instead of Object

Change `mapToModel` as Boolean instead of Object

* add returnning options

* update md for silent and returning
1 parent e9340003
......@@ -210,6 +210,7 @@ This error will have a property for each of the fields for which validation fail
| [options.logging=false] | Function | A function that gets executed while running the query to log the sql. |
| [options.transaction] | Transaction | |
| [options.searchPath=DEFAULT] | String | An optional parameter to specify the schema search_path (Postgres only) |
| [options.returning] | Boolean | Append RETURNING * to get back auto generated values (Postgres only) |
***
......@@ -299,7 +300,7 @@ Destroy the row corresponding to this instance. Depending on your setting for pa
| [options.logging=false] | Function | A function that gets executed while running the query to log the sql. |
| [options.transaction] | Transaction | |
| [options.searchPath=DEFAULT] | String | An optional parameter to specify the schema search_path (Postgres only) |
| [options.silent=false] | Boolean | If true, the updatedAt timestamp will not be updated. |
***
......
......@@ -541,7 +541,8 @@ Builds a new model instance and calls save on it.
| [options.logging=false] | Function | A function that gets executed while running the query to log the sql. |
| [options.searchPath=DEFAULT] | String | An optional parameter to specify the schema search_path (Postgres only) |
| [options.benchmark=false] | Boolean | Print query execution time in milliseconds when logging SQL. |
| [options.returning] | Boolean | Append RETURNING * to get back auto generated values (Postgres only) |
| [options.silent=false] | Boolean | If true, the updatedAt timestamp will not be updated. |
***
......
......@@ -1748,15 +1748,20 @@ class Model {
* @param {Object} [options]
* @param {Boolean} [options.raw=false] If set to true, values will ignore field and virtual setters.
* @param {Boolean} [options.isNewRecord=true]
* @param {Array} [options.include] an array of include options - Used to build prefetched/included model instances. See `set`
* @param {Array} [options.fields] If set, only columns matching those in fields will be saved
* @param {Array} [options.include] an array of include options - Used to build prefetched/included model instances
* @param {String} [options.onDuplicate]
* @param {Transaction} [options.transaction] Transaction to run query under
* @param {string[]} [options.fields] An optional array of strings, representing database columns. If fields is provided, only those columns will be validated and saved.
* @param {Boolean} [options.silent=false] If true, the updatedAt timestamp will not be updated.
* @param {Boolean} [options.validate=true] If false, validations won't be run.
* @param {Boolean} [options.hooks=true] Run before and after create / update + validate hooks
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Pass query execution time in milliseconds as second argument to logging function (options.logging).
* @param {Transaction} [options.transaction] Transaction to run query under
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.returning=true] Return the affected rows (only for postgres)
*
* @return {Promise<Instance>}
*
*/
static create(values, options) {
options = Utils.cloneDeep(options || {});
......@@ -3078,7 +3083,7 @@ class Model {
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Transaction} [options.transaction]
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
*
* @param {Boolean} [options.returning] Append RETURNING * to get back auto generated values (Postgres only)
* @return {Promise<this|Errors.ValidationError>}
*/
save(options) {
......
......@@ -520,7 +520,7 @@ class Sequelize {
* @param {Integer} [options.retry.max] How many times a failing query is automatically retried.
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.supportsSearchPath] If false do not prepend the query with the search_path (Postgres only)
* @param {Object} [options.mapToModel=false] Map returned fields to model's fields if `options.model` or `options.instance` is present. Mapping will occur before building the model instance.
* @param {Boolean} [options.mapToModel=false] Map returned fields to model's fields if `options.model` or `options.instance` is present. Mapping will occur before building the model instance.
* @param {Object} [options.fieldMap] Map returned fields to arbitrary names for `SELECT` query type.
*
* @return {Promise}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!