dobo 2.6.0 → 2.6.2

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.
@@ -203,8 +203,6 @@ export async function sanitizeAll (model) {
203
203
  }
204
204
  }
205
205
  await runHook(`dobo.${camelCase(model.name)}:afterSanitizeModel`, model)
206
- // fields that can participate in table scan if needed
207
- model.scans = []
208
206
  // sorting only possible using these fields
209
207
  model.sortables = []
210
208
  for (const index of model.indexes) {
@@ -239,6 +237,7 @@ async function createSchema (item) {
239
237
  item.connection = null
240
238
  item.hooks = item.hooks ?? []
241
239
  item.disabled = item.disabled ?? []
240
+ item.scanables = item.scanables ?? []
242
241
  if (item.disabled === 'all') item.disabled = ['find', 'get', 'create', 'update', 'remove']
243
242
  else if (item.disabled === 'readonly') item.disabled = ['create', 'update', 'remove']
244
243
  // Is there any overwritten connection?
@@ -63,7 +63,8 @@ export async function getFilterAndOptions (filter = {}, options = {}, action) {
63
63
  for (const key of keys) {
64
64
  nOptions[key] = options[key]
65
65
  }
66
-
66
+ nFilter.orgQuery = nFilter.query
67
+ nFilter.orgSearch = nFilter.search
67
68
  if (!nOptions.noModelHook) await runModelHook(this, 'beforeBuildQuery', nFilter.query, nOptions)
68
69
  nFilter.query = buildFilterQuery.call(this, nFilter) ?? {}
69
70
  if (!nOptions.noModelHook) await runModelHook(this, 'afterBuildQuery', nFilter.query, nOptions)
@@ -237,9 +238,9 @@ export function buildFilterQuery (filter = {}) {
237
238
  filter.search = q
238
239
  return {} //
239
240
  } else {
240
- let scans = [...this.scans]
241
- if (scans.length === 0) scans = [...this.sortables]
242
- const fields = scans.filter(f => {
241
+ let scanables = [...this.scanables]
242
+ if (scanables.length === 0) scanables = [...this.sortables]
243
+ const fields = scanables.filter(f => {
243
244
  const field = find(this.properties, { name: f, type: 'string' })
244
245
  return !!field
245
246
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dobo",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "DBMS for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-02
4
+
5
+ - [2.6.2] Bug fix on query & search resolver: Do not remove old query/search, should always copied to oldQuery/oldSearch
6
+
3
7
  ## 2026-02-01
4
8
 
5
- - [2.6.0] Add ```model.scans``` for fields that can participate in table scans if necessary
9
+ - [2.6.0] Add ```model.scanables``` for fields that can participate in table scans if necessary
6
10
  - [2.6.0] Add ```driver.support.search``` for driver's fulltext search support
7
11
  - [2.6.0] Add model hooks ```before/afterBuildQuery/Search```
8
12