dobo 2.6.2 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -258,7 +258,9 @@ async function driverFactory () {
258
258
  }
259
259
 
260
260
  async _updateRecord (model, id, body = {}, options = {}) {
261
- if (!this.support.uniqueIndex) await this._checkUnique(model, body, options)
261
+ if (!options.noUniqueCheck) {
262
+ if (!this.support.uniqueIndex) await this._checkUnique(model, body, options)
263
+ }
262
264
  if (!options._data) {
263
265
  const resp = await this.getRecord(model, id, { noHook: true })
264
266
  if (!resp.data) throw this.plugin.error('recordNotFound%s%s', id, model.name)
@@ -274,7 +276,9 @@ async function driverFactory () {
274
276
  }
275
277
 
276
278
  async _upsertRecord (model, body = {}, options = {}) {
277
- if (!this.uniqueIndexSupport) await this._checkUnique(model, body, options)
279
+ if (!options.noUniqueCheck) {
280
+ if (!this.uniqueIndexSupport) await this._checkUnique(model, body, options)
281
+ }
278
282
  if (isSet(body.id)) {
279
283
  if (!options._data) {
280
284
  const resp = await this.getRecord(model, body.id, { noHook: true })
@@ -18,7 +18,8 @@ async function sanitizeRecord (record = {}, opts = {}) {
18
18
  if (isEmpty(newFields)) newFields = map(this.properties, prop => prop.name)
19
19
  if (!newFields.includes('id')) newFields.unshift('id')
20
20
  newFields = without(newFields, ...allHidden)
21
- const newRecord = await this.sanitizeBody({ body: fillObject(record, newFields, null), noDefault: true })
21
+ const body = fillObject(record, newFields, null)
22
+ const newRecord = await this.sanitizeBody({ body, noDefault: true })
22
23
  if (record._ref) newRecord._ref = record._ref
23
24
  return newRecord
24
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dobo",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "DBMS for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-05
4
+
5
+ - [2.6.5] Bug fix on driver options, ```noCheckUnique``` must be perform in ```create```, ```update``` and ```upsert```
6
+
7
+ ## 2026-02-03
8
+
9
+ - [2.6.3] Bug fix on ```model.sanitizeRecord()```
10
+
3
11
  ## 2026-02-02
4
12
 
5
13
  - [2.6.2] Bug fix on query & search resolver: Do not remove old query/search, should always copied to oldQuery/oldSearch