dobo 2.13.0 → 2.14.0

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.
@@ -236,6 +236,22 @@ export async function getMultiRefs (records = [], options = {}) {
236
236
  }
237
237
  }
238
238
 
239
+ export function parseNql (text) {
240
+ const sanitized = text.split('+').map(item => {
241
+ const [key, ...rest] = item.split(':').map(i => i.trim())
242
+ let value = rest.join(':')
243
+ const neg = value[1] === '-' ? '-' : ''
244
+ if ((value[0] === '{' || value[1] === '{') && value[value.length - 1] === '}') {
245
+ if (value[0] === '-') value = value.slice(1)
246
+ const items = value.slice(1, -1).split(',')
247
+ value = `${neg}>=${items[0]}+${key}:${neg}<=${items[1]}`
248
+ }
249
+ return `${key}:${value}`
250
+ }).join('+')
251
+
252
+ return nql(sanitized).parse()
253
+ }
254
+
239
255
  export function buildFilterQuery (filter = {}) {
240
256
  const { trim, find, isString, isPlainObject } = this.app.lib._
241
257
  let query = filter.query ?? {}
@@ -244,7 +260,7 @@ export function buildFilterQuery (filter = {}) {
244
260
  try {
245
261
  query = trim(query)
246
262
  if (query.startsWith('{')) q = JSON.parse(query) // JSON formatted query
247
- else if (query.includes(':')) q = nql(query).parse() // NQL
263
+ else if (query.includes(':')) q = parseNql.call(this, query) // NQL
248
264
  else {
249
265
  let scanables = [...this.scanables]
250
266
  if (scanables.length === 0) scanables = [...this.sortables]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dobo",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "DBMS for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-01
4
+
5
+ - [2.14.0] Add ```between``` as custom query, since it doesn't exists in NQL
6
+
3
7
  ## 2026-03-30
4
8
 
5
9
  - [2.12.0] Add ```.bootorder``` level 10