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

Commit 93b843be by Mick Hansen

[ci skip] docs on docs on docs

1 parent 1040da6b
Showing with 32 additions and 24 deletions
...@@ -717,8 +717,9 @@ module.exports = (function() { ...@@ -717,8 +717,9 @@ module.exports = (function() {
/** /**
* Destroy the row corresponding to this instance. Depending on your setting for paranoid, the row will either be completely deleted, or have its deletedAt timestamp set to the current time. * Destroy the row corresponding to this instance. Depending on your setting for paranoid, the row will either be completely deleted, or have its deletedAt timestamp set to the current time.
* *
* @param {Object} [options={}] * @param {Object} [options={}]
* @param {Boolean} [options.force=false] If set to true, paranoid models will actually be deleted * @param {Boolean} [options.force=false] If set to true, paranoid models will actually be deleted
* @param {Transaction} [options.transaction]
* *
* @return {Promise<undefined>} * @return {Promise<undefined>}
*/ */
...@@ -759,7 +760,8 @@ module.exports = (function() { ...@@ -759,7 +760,8 @@ module.exports = (function() {
/** /**
* Restore the row corresponding to this instance. Only available for paranoid models. * Restore the row corresponding to this instance. Only available for paranoid models.
* *
* @param {Object} [options={}] * @param {Object} [options={}]
* @param {Transaction} [options.transaction]
* *
* @return {Promise<undefined>} * @return {Promise<undefined>}
*/ */
......
...@@ -662,8 +662,8 @@ module.exports = (function() { ...@@ -662,8 +662,8 @@ module.exports = (function() {
* @param {String|Array|Sequelize.fn} [options.order] Specifies an ordering. If a string is provided, it will be esacped. Using an array, you can provide several columns / functions to order by. Each element can be further wrapped in a two-element array. The first element is the column / function to order by, the second is the direction. For example: `order: [['name', 'DESC']]`. In this way the column will be escaped, but the direction will not. * @param {String|Array|Sequelize.fn} [options.order] Specifies an ordering. If a string is provided, it will be esacped. Using an array, you can provide several columns / functions to order by. Each element can be further wrapped in a two-element array. The first element is the column / function to order by, the second is the direction. For example: `order: [['name', 'DESC']]`. In this way the column will be escaped, but the direction will not.
* @param {Number} [options.limit] * @param {Number} [options.limit]
* @param {Number} [options.offset] * @param {Number} [options.offset]
* @param {Transaction} [options.transaction]
* @param {Object} [queryOptions] Set the query options, e.g. raw, specifying that you want raw data instead of built Instances. See sequelize.query for options * @param {Object} [queryOptions] Set the query options, e.g. raw, specifying that you want raw data instead of built Instances. See sequelize.query for options
* @param {Transaction} [queryOptions.transaction]
* @param {String} [queryOptions.lock] Lock the selected rows in either share or update mode. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. See [transaction.LOCK for an example](https://github.com/sequelize/sequelize/wiki/API-Reference-Transaction#LOCK) * @param {String} [queryOptions.lock] Lock the selected rows in either share or update mode. Possible options are transaction.LOCK.UPDATE and transaction.LOCK.SHARE. See [transaction.LOCK for an example](https://github.com/sequelize/sequelize/wiki/API-Reference-Transaction#LOCK)
* *
* @see {Sequelize#query} * @see {Sequelize#query}
...@@ -751,6 +751,7 @@ module.exports = (function() { ...@@ -751,6 +751,7 @@ module.exports = (function() {
* Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single instance. * Search for a single instance. This applies LIMIT 1, so the listener will always be called with a single instance.
* *
* @param {Object|Number} [options] A hash of options to describe the scope of the search, or a number to search by id. * @param {Object|Number} [options] A hash of options to describe the scope of the search, or a number to search by id.
* @param {Transaction} [options.transaction]
* @param {Object} [queryOptions] * @param {Object} [queryOptions]
* *
* @see {Model#findAll} for an explanation of options and queryOptions * @see {Model#findAll} for an explanation of options and queryOptions
...@@ -790,6 +791,7 @@ module.exports = (function() { ...@@ -790,6 +791,7 @@ module.exports = (function() {
* @param {Object} [options] Query options. See sequelize.query for full options * @param {Object} [options] Query options. See sequelize.query for full options
* @param {DataType|String} [options.dataType] The type of the result. If `field` is a field in this Model, the default will be the type of that field, otherwise defaults to float. * @param {DataType|String} [options.dataType] The type of the result. If `field` is a field in this Model, the default will be the type of that field, otherwise defaults to float.
* @param {boolean} [options.distinct] Applies DISTINCT to the field being aggregated over * @param {boolean} [options.distinct] Applies DISTINCT to the field being aggregated over
* @param {Transaction} [options.transaction]
* *
* @return {Promise<options.dataType>} * @return {Promise<options.dataType>}
*/ */
...@@ -1374,14 +1376,15 @@ module.exports = (function() { ...@@ -1374,14 +1376,15 @@ module.exports = (function() {
/** /**
* Delete multiple instances, or set their deletedAt timestamp to the current time if `paranoid` is enabled. * Delete multiple instances, or set their deletedAt timestamp to the current time if `paranoid` is enabled.
* *
* @param {Object} [options.where] Filter the destroy * @param {Object} options
* @param {Boolean} [options.hooks=true] Run before / after bulk destroy hooks? * @param {Object} [options.where] Filter the destroy
* @param {Boolean} [options.individualHooks=false] If set to true, destroy will find all records within the where parameter and will execute before / after bulkDestroy hooks on each row * @param {Boolean} [options.hooks=true] Run before / after bulk destroy hooks?
* @param {Number} [options.limit] How many rows to delete * @param {Boolean} [options.individualHooks=false] If set to true, destroy will find all records within the where parameter and will execute before / after bulkDestroy hooks on each row
* @param {Boolean} [options.force=false] Delete instead of setting deletedAt to current timestamp (only applicable if `paranoid` is enabled) * @param {Number} [options.limit] How many rows to delete
* @param {Boolean} [options.truncate=false] If set to true, dialects that support it will use TRUNCATE instead of DELETE FROM. If a table is truncated the where and limit options are ignored * @param {Boolean} [options.force=false] Delete instead of setting deletedAt to current timestamp (only applicable if `paranoid` is enabled)
* @param {Boolean} [options.cascade=false] Only used in conjuction with TRUNCATE. Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE. * @param {Boolean} [options.truncate=false] If set to true, dialects that support it will use TRUNCATE instead of DELETE FROM. If a table is truncated the where and limit options are ignored
* * @param {Boolean} [options.cascade=false] Only used in conjuction with TRUNCATE. Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE.
* @param {Transaction} [options.transaction]
* @return {Promise<undefined>} * @return {Promise<undefined>}
*/ */
Model.prototype.destroy = function(options) { Model.prototype.destroy = function(options) {
...@@ -1444,10 +1447,12 @@ module.exports = (function() { ...@@ -1444,10 +1447,12 @@ module.exports = (function() {
/** /**
* Restore multiple instances if `paranoid` is enabled. * Restore multiple instances if `paranoid` is enabled.
* *
* @param {Object} [options.where] Filter the restore * @param {Object} options
* @param {Boolean} [options.hooks=true] Run before / after bulk restore hooks? * @param {Object} [options.where] Filter the restore
* @param {Boolean} [options.individualHooks=false] If set to true, restore will find all records within the where parameter and will execute before / after bulkRestore hooks on each row * @param {Boolean} [options.hooks=true] Run before / after bulk restore hooks?
* @param {Number} [options.limit] How many rows to undelete * @param {Boolean} [options.individualHooks=false] If set to true, restore will find all records within the where parameter and will execute before / after bulkRestore hooks on each row
* @param {Number} [options.limit] How many rows to undelete
* @param {Transaction} [options.transaction]
* *
* @return {Promise<undefined>} * @return {Promise<undefined>}
*/ */
...@@ -1509,14 +1514,15 @@ module.exports = (function() { ...@@ -1509,14 +1514,15 @@ module.exports = (function() {
* Update multiple instances that match the where options. The promise returns an array with one or two elements. The first element is always the number * Update multiple instances that match the where options. The promise returns an array with one or two elements. The first element is always the number
* of affected rows, while the second element is the actual affected rows (only supported in postgres with `options.returning` true.) * of affected rows, while the second element is the actual affected rows (only supported in postgres with `options.returning` true.)
* *
* @param {Object} values * @param {Object} values
* @param {Object} options * @param {Object} options
* @param {Object options.where Options to describe the scope of the search. * @param {Object options.where Options to describe the scope of the search.
* @param {Boolean} [options.validate=true] Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation * @param {Boolean} [options.validate=true] Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation
* @param {Boolean} [options.hooks=true] Run before / after bulk update hooks? * @param {Boolean} [options.hooks=true] Run before / after bulk update hooks?
* @param {Boolean} [options.individualHooks=false] Run before / after update hooks? * @param {Boolean} [options.individualHooks=false] Run before / after update hooks?
* @param {Boolean} [options.returning=false] Return the affected rows (only for postgres) * @param {Boolean} [options.returning=false] Return the affected rows (only for postgres)
* @param {Number} [options.limit] How many rows to update (only for mysql and mariadb) * @param {Number} [options.limit] How many rows to update (only for mysql and mariadb)
* @param {Transaction} [options.transaction]
* *
* @return {Promise<Array<affectedCount,affectedRows>>} * @return {Promise<Array<affectedCount,affectedRows>>}
*/ */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!