@naturalcycles/db-lib 10.6.0 → 10.8.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.
Files changed (94) hide show
  1. package/dist/adapter/cachedb/cache.db.d.ts +4 -3
  2. package/dist/adapter/cachedb/cache.db.js +2 -2
  3. package/dist/adapter/cachedb/cache.db.model.d.ts +3 -2
  4. package/dist/adapter/file/file.db.d.ts +4 -3
  5. package/dist/adapter/file/file.db.js +9 -4
  6. package/dist/adapter/file/file.db.model.d.ts +2 -1
  7. package/dist/adapter/file/inMemory.persistence.plugin.d.ts +1 -1
  8. package/dist/adapter/file/localFile.persistence.plugin.d.ts +1 -1
  9. package/dist/adapter/file/localFile.persistence.plugin.js +1 -1
  10. package/dist/adapter/file/noop.persistence.plugin.d.ts +1 -1
  11. package/dist/commondao/common.dao.d.ts +3 -1
  12. package/dist/commondao/common.dao.js +15 -9
  13. package/dist/commondao/common.dao.model.d.ts +14 -8
  14. package/dist/commondao/index.d.ts +2 -0
  15. package/dist/commondao/index.js +2 -0
  16. package/dist/{base.common.db.d.ts → commondb/base.common.db.d.ts} +4 -3
  17. package/dist/{base.common.db.js → commondb/base.common.db.js} +1 -1
  18. package/dist/{common.db.d.ts → commondb/common.db.d.ts} +4 -3
  19. package/dist/db.model.d.ts +2 -2
  20. package/dist/index.d.ts +2 -13
  21. package/dist/index.js +2 -13
  22. package/dist/{adapter/inmemory → inmemory}/inMemory.db.d.ts +7 -5
  23. package/dist/{adapter/inmemory → inmemory}/inMemory.db.js +8 -2
  24. package/dist/{adapter/inmemory → inmemory}/inMemoryKeyValueDB.d.ts +3 -3
  25. package/dist/{adapter/inmemory → inmemory}/inMemoryKeyValueDB.js +1 -1
  26. package/dist/inmemory/index.d.ts +3 -0
  27. package/dist/inmemory/index.js +3 -0
  28. package/dist/inmemory/queryInMemory.d.ts +3 -0
  29. package/dist/{adapter/inmemory → inmemory}/queryInMemory.js +1 -1
  30. package/dist/kv/commonKeyValueDB.d.ts +1 -1
  31. package/dist/kv/commonKeyValueDao.d.ts +2 -1
  32. package/dist/kv/commonKeyValueDao.js +2 -1
  33. package/dist/kv/commonKeyValueDaoMemoCache.d.ts +3 -2
  34. package/dist/kv/commonKeyValueDaoMemoCache.js +2 -1
  35. package/dist/kv/index.d.ts +3 -0
  36. package/dist/kv/index.js +3 -0
  37. package/dist/model.util.d.ts +1 -1
  38. package/dist/model.util.js +1 -1
  39. package/dist/pipeline/dbPipelineBackup.d.ts +3 -3
  40. package/dist/pipeline/dbPipelineBackup.js +4 -1
  41. package/dist/pipeline/dbPipelineCopy.d.ts +3 -3
  42. package/dist/pipeline/dbPipelineCopy.js +4 -1
  43. package/dist/pipeline/dbPipelineRestore.d.ts +3 -3
  44. package/dist/pipeline/dbPipelineRestore.js +6 -1
  45. package/dist/pipeline/index.d.ts +3 -0
  46. package/dist/pipeline/index.js +3 -0
  47. package/dist/query/dbQuery.d.ts +1 -1
  48. package/dist/query/dbQuery.js +2 -1
  49. package/dist/testing/commonDBTest.d.ts +1 -1
  50. package/dist/testing/commonDBTest.js +5 -2
  51. package/dist/testing/commonDaoTest.d.ts +1 -1
  52. package/dist/testing/commonDaoTest.js +3 -1
  53. package/dist/testing/test.model.d.ts +2 -1
  54. package/dist/testing/test.model.js +2 -1
  55. package/dist/timeseries/timeSeries.model.d.ts +1 -1
  56. package/dist/transaction/dbTransaction.util.d.ts +2 -2
  57. package/package.json +8 -4
  58. package/src/adapter/cachedb/cache.db.model.ts +3 -2
  59. package/src/adapter/cachedb/cache.db.ts +5 -9
  60. package/src/adapter/file/file.db.model.ts +2 -1
  61. package/src/adapter/file/file.db.ts +13 -15
  62. package/src/adapter/file/inMemory.persistence.plugin.ts +1 -1
  63. package/src/adapter/file/localFile.persistence.plugin.ts +2 -2
  64. package/src/adapter/file/noop.persistence.plugin.ts +1 -1
  65. package/src/commondao/common.dao.model.ts +15 -11
  66. package/src/commondao/common.dao.ts +22 -32
  67. package/src/commondao/index.ts +2 -0
  68. package/src/{base.common.db.ts → commondb/base.common.db.ts} +7 -11
  69. package/src/{common.db.ts → commondb/common.db.ts} +4 -8
  70. package/src/db.model.ts +2 -2
  71. package/src/index.ts +2 -13
  72. package/src/{adapter/inmemory → inmemory}/inMemory.db.ts +19 -22
  73. package/src/{adapter/inmemory → inmemory}/inMemoryKeyValueDB.ts +4 -8
  74. package/src/inmemory/index.ts +3 -0
  75. package/src/{adapter/inmemory → inmemory}/queryInMemory.ts +3 -3
  76. package/src/kv/commonKeyValueDB.ts +1 -1
  77. package/src/kv/commonKeyValueDao.ts +4 -2
  78. package/src/kv/commonKeyValueDaoMemoCache.ts +4 -2
  79. package/src/kv/index.ts +3 -0
  80. package/src/model.util.ts +2 -2
  81. package/src/pipeline/dbPipelineBackup.ts +6 -3
  82. package/src/pipeline/dbPipelineCopy.ts +6 -3
  83. package/src/pipeline/dbPipelineRestore.ts +9 -15
  84. package/src/pipeline/index.ts +3 -0
  85. package/src/query/dbQuery.ts +3 -2
  86. package/src/testing/commonDBTest.ts +6 -3
  87. package/src/testing/commonDaoTest.ts +4 -2
  88. package/src/testing/keyValueDBTest.ts +1 -1
  89. package/src/testing/test.model.ts +4 -2
  90. package/src/timeseries/commonTimeSeriesDao.ts +1 -1
  91. package/src/timeseries/timeSeries.model.ts +1 -1
  92. package/src/transaction/dbTransaction.util.ts +2 -2
  93. package/dist/adapter/inmemory/queryInMemory.d.ts +0 -3
  94. /package/dist/{common.db.js → commondb/common.db.js} +0 -0
@@ -1,9 +1,11 @@
1
1
  import { Readable } from 'node:stream'
2
- import { _deepCopy, _filterObject, _omit, _pick, _sortBy, localTime } from '@naturalcycles/js-lib'
2
+ import { _sortBy } from '@naturalcycles/js-lib'
3
+ import { localTime } from '@naturalcycles/js-lib/datetime'
4
+ import { _deepCopy, _filterObject, _omit, _pick } from '@naturalcycles/js-lib/object'
3
5
  import { _pipeline } from '@naturalcycles/nodejs-lib/stream'
4
- import type { CommonDB } from '../common.db.js'
5
6
  import { CommonDao } from '../commondao/common.dao.js'
6
7
  import { CommonDaoLogLevel } from '../commondao/common.dao.model.js'
8
+ import type { CommonDB } from '../commondb/common.db.js'
7
9
  import { DBQuery } from '../query/dbQuery.js'
8
10
  import type { CommonDBImplementationQuirks } from './commonDBTest.js'
9
11
  import type { TestItemBM } from './test.model.js'
@@ -1,5 +1,5 @@
1
- import type { KeyValueTuple } from '@naturalcycles/js-lib'
2
1
  import { _range, _sortBy } from '@naturalcycles/js-lib'
2
+ import type { KeyValueTuple } from '@naturalcycles/js-lib/types'
3
3
  import type { CommonKeyValueDB } from '../kv/commonKeyValueDB.js'
4
4
  import { TEST_TABLE } from './test.model.js'
5
5
 
@@ -1,5 +1,7 @@
1
- import type { BaseDBEntity, JsonSchemaObject, UnixTimestamp } from '@naturalcycles/js-lib'
2
- import { _range, jsonSchema } from '@naturalcycles/js-lib'
1
+ import { _range } from '@naturalcycles/js-lib'
2
+ import type { JsonSchemaObject } from '@naturalcycles/js-lib/json-schema'
3
+ import { jsonSchema } from '@naturalcycles/js-lib/json-schema'
4
+ import type { BaseDBEntity, UnixTimestamp } from '@naturalcycles/js-lib/types'
3
5
  import {
4
6
  baseDBEntitySchema,
5
7
  binarySchema,
@@ -1,5 +1,5 @@
1
- import type { ObjectWithId } from '@naturalcycles/js-lib'
2
1
  import { _isTruthy } from '@naturalcycles/js-lib'
2
+ import type { ObjectWithId } from '@naturalcycles/js-lib/types'
3
3
  import { DBQuery } from '../query/dbQuery.js'
4
4
  import type {
5
5
  CommonTimeSeriesDaoCfg,
@@ -1,4 +1,4 @@
1
- import type { CommonDB } from '../common.db.js'
1
+ import type { CommonDB } from '../commondb/common.db.js'
2
2
 
3
3
  export interface CommonTimeSeriesDaoCfg {
4
4
  db: CommonDB
@@ -1,5 +1,5 @@
1
- import type { ObjectWithId } from '@naturalcycles/js-lib'
2
- import type { CommonDB } from '../common.db.js'
1
+ import type { ObjectWithId } from '@naturalcycles/js-lib/types'
2
+ import type { CommonDB } from '../commondb/common.db.js'
3
3
  import type { CommonDBOptions, CommonDBSaveOptions, DBTransaction } from '../db.model.js'
4
4
 
5
5
  /**
@@ -1,3 +0,0 @@
1
- import type { ObjectWithId } from '@naturalcycles/js-lib';
2
- import type { DBQuery } from '../../query/dbQuery.js';
3
- export declare function queryInMemory<ROW extends ObjectWithId>(q: DBQuery<ROW>, rows?: ROW[]): ROW[];
File without changes