Comparing version 2.14.5 to 2.14.6
@@ -217,3 +217,3 @@ /* UNIQORM | ||
* | ||
* @param {*|{string: *}} value Key field value(s) | ||
* @param {*} keyValues Key field value(s) | ||
* @param {Object} [options] | ||
@@ -228,6 +228,6 @@ * @param {Object|Array} options.properties | ||
*/ | ||
get(value, options = {}) { | ||
get(keyValues, options = {}) { | ||
return promisify(() => { | ||
const opts = merge({ | ||
where: this._prepareKeyValues(value), | ||
where: this._prepareKeyValues(keyValues), | ||
limit: 1 | ||
@@ -410,3 +410,3 @@ }, options, {adjunct: true}); | ||
* | ||
* @param {Object} [where] | ||
* @param {*} [keyValues] | ||
* @param {Object} [options] | ||
@@ -418,11 +418,31 @@ * @param {Boolean} [options.autoCommit] | ||
*/ | ||
destroy(where, options = {}) { | ||
destroy(keyValues, options = {}) { | ||
return this.destroyMany(merge({ | ||
where: this._prepareKeyValues(keyValues) | ||
}, options, {adjunct: true})); | ||
} | ||
/** | ||
* Performs delete | ||
* | ||
* @param {Object} [options] | ||
* @param {Object|Array<Object>} [options.where] | ||
* @param {Boolean} [options.autoCommit] | ||
* @param {Object} [options.connection] | ||
* @param {Boolean} [options.silent] | ||
* @return {Promise<{executeTime:number, queriesExecuted:number, rowsAffected:number}>} | ||
*/ | ||
destroyMany(options = {}) { | ||
return promisify(() => { | ||
if (typeof where !== 'object') | ||
where = this._prepareKeyValues(where); | ||
if (options.where) { | ||
options.where = this._mapConditions(options.where); | ||
options.where = Array.isArray(options.where) ? | ||
/* istanbul ignore next */ options.where : [options.where]; | ||
} | ||
const dbobj = (options.connection || this.orm.pool); | ||
return dbobj | ||
.delete(this.tableNameFull) | ||
.where(where) | ||
.where(...options.where) | ||
.execute({ | ||
@@ -429,0 +449,0 @@ autoCommit: options.autoCommit |
{ | ||
"name": "uniqorm", | ||
"description": "Multi dialect and multi schema ORM framework for enterprise level NodeJS applications", | ||
"version": "2.14.5", | ||
"version": "2.14.6", | ||
"author": "Panates Ltd.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -18,3 +18,3 @@ # Uniqorm | ||
- Can work with any dialect that [SQB](https://github.com/panates/sqb) supports | ||
- Can work with any dialect that [SQB](https://github.com/sqbjs/sqb) supports | ||
- Supports multi schemas | ||
@@ -37,15 +37,15 @@ - Supports One2One, One2Many, Many2Many associations | ||
[npm-url]: https://npmjs.org/package/uniqorm | ||
[travis-image]: https://travis-ci.org/panates/uniqorm.svg?branch=master | ||
[travis-url]: https://travis-ci.org/panates/uniqorm# | ||
[coveralls-image]: https://img.shields.io/coveralls/panates/uniqorm/master.svg | ||
[coveralls-url]: https://coveralls.io/r/panates/uniqorm | ||
[travis-image]: https://travis-ci.org/sqbjs/uniqorm.svg?branch=master | ||
[travis-url]: https://travis-ci.org/sqbjs/uniqorm# | ||
[coveralls-image]: https://img.shields.io/coveralls/sqbjs/uniqorm/master.svg | ||
[coveralls-url]: https://coveralls.io/r/sqbjs/uniqorm | ||
[downloads-image]: https://img.shields.io/npm/dm/uniqorm.svg | ||
[downloads-url]: https://npmjs.org/package/uniqorm | ||
[gitter-image]: https://badges.gitter.im/panates/uniqorm.svg | ||
[gitter-url]: https://gitter.im/panates/uniqorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | ||
[dependencies-image]: https://david-dm.org/panates/uniqorm/status.svg | ||
[dependencies-url]:https://david-dm.org/panates/uniqorm | ||
[devdependencies-image]: https://david-dm.org/panates/uniqorm/dev-status.svg | ||
[devdependencies-url]:https://david-dm.org/panates/uniqorm?type=dev | ||
[gitter-image]: https://badges.gitter.im/sqbjs/uniqorm.svg | ||
[gitter-url]: https://gitter.im/sqbjs/uniqorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge | ||
[dependencies-image]: https://david-dm.org/sqbjs/uniqorm/status.svg | ||
[dependencies-url]:https://david-dm.org/sqbjs/uniqorm | ||
[devdependencies-image]: https://david-dm.org/sqbjs/uniqorm/dev-status.svg | ||
[devdependencies-url]:https://david-dm.org/sqbjs/uniqorm?type=dev | ||
[quality-image]: http://npm.packagequality.com/shield/uniqorm.png | ||
[quality-url]: http://packagequality.com/#?package=uniqorm |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95028
3118