@naturalcycles/db-lib 8.42.0 → 8.42.1
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.
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
export * from './adapter/inmemory/inMemory.db';
|
|
2
|
+
export * from './adapter/inmemory/inMemoryKeyValueDB';
|
|
3
|
+
export * from './adapter/inmemory/queryInMemory';
|
|
4
|
+
export * from './base.common.db';
|
|
5
|
+
export * from './cnst';
|
|
6
|
+
export * from './common.db';
|
|
7
|
+
export * from './commondao/common.dao';
|
|
8
|
+
export * from './commondao/common.dao.model';
|
|
9
|
+
export * from './db.model';
|
|
10
|
+
export * from './kv/commonKeyValueDao';
|
|
11
|
+
export * from './kv/commonKeyValueDB';
|
|
12
|
+
export * from './model.util';
|
|
13
|
+
export * from './pipeline/dbPipelineBackup';
|
|
14
|
+
export * from './pipeline/dbPipelineCopy';
|
|
15
|
+
export * from './pipeline/dbPipelineRestore';
|
|
16
|
+
export * from './query/dbQuery';
|
|
17
|
+
export * from './transaction/dbTransaction';
|
|
18
|
+
export * from './transaction/dbTransaction.util';
|
|
19
19
|
export * from './kv/commonKeyValueDaoMemoCache';
|
|
20
|
-
export type { DBQueryFilterOperator, DBQueryFilter, DBQueryOrder, CommonDaoCreateOptions, CommonDaoOptions, CommonDaoSaveOptions, CommonDaoStreamForEachOptions, CommonDaoStreamOptions, CommonDaoHooks, CommonDBOptions, CommonDBSaveOptions, CommonDBSaveMethod, CommonDBStreamOptions, CommonDBCreateOptions, CommonDB, RunQueryResult, CommonDaoCfg, InMemoryDBCfg, InMemoryKeyValueDBCfg, DBPipelineBackupOptions, DBPipelineRestoreOptions, DBPipelineCopyOptions, DBOperation, DBSaveBatchOperation, DBDeleteByIdsOperation, CommonKeyValueDB, CommonKeyValueDaoCfg, KeyValueDBTuple, };
|
|
21
|
-
export { DBQuery, dbQueryFilterOperatorValues, RunnableDBQuery, CommonDaoLogLevel, DBRelation, DBModelType, CommonDao, createdUpdatedFields, createdUpdatedIdFields, InMemoryDB, InMemoryKeyValueDB, queryInMemory, serializeJsonField, deserializeJsonField, dbPipelineBackup, dbPipelineRestore, dbPipelineCopy, DBLibError, BaseCommonDB, DBTransaction, RunnableDBTransaction, commitDBTransactionSimple, CommonKeyValueDao, };
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommonKeyValueDao = exports.commitDBTransactionSimple = exports.RunnableDBTransaction = exports.DBTransaction = exports.BaseCommonDB = exports.DBLibError = exports.dbPipelineCopy = exports.dbPipelineRestore = exports.dbPipelineBackup = exports.deserializeJsonField = exports.serializeJsonField = exports.queryInMemory = exports.InMemoryKeyValueDB = exports.InMemoryDB = exports.createdUpdatedIdFields = exports.createdUpdatedFields = exports.CommonDao = exports.DBModelType = exports.DBRelation = exports.CommonDaoLogLevel = exports.RunnableDBQuery = exports.dbQueryFilterOperatorValues = exports.DBQuery = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(exports, "CommonKeyValueDao", { enumerable: true, get: function () { return commonKeyValueDao_1.CommonKeyValueDao; } });
|
|
24
|
-
const model_util_1 = require("./model.util");
|
|
25
|
-
Object.defineProperty(exports, "createdUpdatedFields", { enumerable: true, get: function () { return model_util_1.createdUpdatedFields; } });
|
|
26
|
-
Object.defineProperty(exports, "createdUpdatedIdFields", { enumerable: true, get: function () { return model_util_1.createdUpdatedIdFields; } });
|
|
27
|
-
Object.defineProperty(exports, "deserializeJsonField", { enumerable: true, get: function () { return model_util_1.deserializeJsonField; } });
|
|
28
|
-
Object.defineProperty(exports, "serializeJsonField", { enumerable: true, get: function () { return model_util_1.serializeJsonField; } });
|
|
29
|
-
const dbPipelineBackup_1 = require("./pipeline/dbPipelineBackup");
|
|
30
|
-
Object.defineProperty(exports, "dbPipelineBackup", { enumerable: true, get: function () { return dbPipelineBackup_1.dbPipelineBackup; } });
|
|
31
|
-
const dbPipelineCopy_1 = require("./pipeline/dbPipelineCopy");
|
|
32
|
-
Object.defineProperty(exports, "dbPipelineCopy", { enumerable: true, get: function () { return dbPipelineCopy_1.dbPipelineCopy; } });
|
|
33
|
-
const dbPipelineRestore_1 = require("./pipeline/dbPipelineRestore");
|
|
34
|
-
Object.defineProperty(exports, "dbPipelineRestore", { enumerable: true, get: function () { return dbPipelineRestore_1.dbPipelineRestore; } });
|
|
35
|
-
const dbQuery_1 = require("./query/dbQuery");
|
|
36
|
-
Object.defineProperty(exports, "DBQuery", { enumerable: true, get: function () { return dbQuery_1.DBQuery; } });
|
|
37
|
-
Object.defineProperty(exports, "dbQueryFilterOperatorValues", { enumerable: true, get: function () { return dbQuery_1.dbQueryFilterOperatorValues; } });
|
|
38
|
-
Object.defineProperty(exports, "RunnableDBQuery", { enumerable: true, get: function () { return dbQuery_1.RunnableDBQuery; } });
|
|
39
|
-
const dbTransaction_1 = require("./transaction/dbTransaction");
|
|
40
|
-
Object.defineProperty(exports, "DBTransaction", { enumerable: true, get: function () { return dbTransaction_1.DBTransaction; } });
|
|
41
|
-
Object.defineProperty(exports, "RunnableDBTransaction", { enumerable: true, get: function () { return dbTransaction_1.RunnableDBTransaction; } });
|
|
42
|
-
const dbTransaction_util_1 = require("./transaction/dbTransaction.util");
|
|
43
|
-
Object.defineProperty(exports, "commitDBTransactionSimple", { enumerable: true, get: function () { return dbTransaction_util_1.commitDBTransactionSimple; } });
|
|
4
|
+
tslib_1.__exportStar(require("./adapter/inmemory/inMemory.db"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./adapter/inmemory/inMemoryKeyValueDB"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./adapter/inmemory/queryInMemory"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./base.common.db"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./cnst"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./common.db"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./commondao/common.dao"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./commondao/common.dao.model"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./db.model"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./kv/commonKeyValueDao"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./kv/commonKeyValueDB"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./model.util"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./pipeline/dbPipelineBackup"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./pipeline/dbPipelineCopy"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./pipeline/dbPipelineRestore"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./query/dbQuery"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./transaction/dbTransaction"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./transaction/dbTransaction.util"), exports);
|
|
44
22
|
tslib_1.__exportStar(require("./kv/commonKeyValueDaoMemoCache"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonDB } from '../common.db';
|
|
2
|
-
import { CommonDBSaveOptions } from '../db.model';
|
|
2
|
+
import { CommonDBSaveOptions, DBOperation } from '../db.model';
|
|
3
3
|
import { DBTransaction } from './dbTransaction';
|
|
4
4
|
/**
|
|
5
5
|
* Optimizes the Transaction (list of DBOperations) to do less operations.
|
|
@@ -9,6 +9,7 @@ import { DBTransaction } from './dbTransaction';
|
|
|
9
9
|
* Currently only takes into account SaveBatch and DeleteByIds ops.
|
|
10
10
|
* Output ops are maximum 1 per entity - save or delete.
|
|
11
11
|
*/
|
|
12
|
+
export declare function mergeDBOperations(ops: DBOperation[]): DBOperation[];
|
|
12
13
|
/**
|
|
13
14
|
* Naive implementation of "Transaction" which just executes all operations one-by-one.
|
|
14
15
|
* Does NOT actually implement a Transaction, cause partial ops application will happen
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.commitDBTransactionSimple = void 0;
|
|
3
|
+
exports.commitDBTransactionSimple = exports.mergeDBOperations = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Optimizes the Transaction (list of DBOperations) to do less operations.
|
|
6
6
|
* E.g if you save id1 first and then delete it - this function will turn it into a no-op (self-eliminate).
|
|
@@ -9,6 +9,10 @@ exports.commitDBTransactionSimple = void 0;
|
|
|
9
9
|
* Currently only takes into account SaveBatch and DeleteByIds ops.
|
|
10
10
|
* Output ops are maximum 1 per entity - save or delete.
|
|
11
11
|
*/
|
|
12
|
+
function mergeDBOperations(ops) {
|
|
13
|
+
return ops; // currently "does nothing"
|
|
14
|
+
}
|
|
15
|
+
exports.mergeDBOperations = mergeDBOperations;
|
|
12
16
|
// Commented out as "overly complicated"
|
|
13
17
|
/*
|
|
14
18
|
export function mergeDBOperations(ops: DBOperation[]): DBOperation[] {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,109 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
CommonDBCreateOptions,
|
|
20
|
-
CommonDBOptions,
|
|
21
|
-
CommonDBSaveMethod,
|
|
22
|
-
CommonDBSaveOptions,
|
|
23
|
-
CommonDBStreamOptions,
|
|
24
|
-
DBDeleteByIdsOperation,
|
|
25
|
-
DBModelType,
|
|
26
|
-
DBOperation,
|
|
27
|
-
DBRelation,
|
|
28
|
-
DBSaveBatchOperation,
|
|
29
|
-
RunQueryResult,
|
|
30
|
-
} from './db.model'
|
|
31
|
-
import { CommonKeyValueDao, CommonKeyValueDaoCfg } from './kv/commonKeyValueDao'
|
|
32
|
-
import { CommonKeyValueDB, KeyValueDBTuple } from './kv/commonKeyValueDB'
|
|
33
|
-
import {
|
|
34
|
-
createdUpdatedFields,
|
|
35
|
-
createdUpdatedIdFields,
|
|
36
|
-
deserializeJsonField,
|
|
37
|
-
serializeJsonField,
|
|
38
|
-
} from './model.util'
|
|
39
|
-
import { dbPipelineBackup, DBPipelineBackupOptions } from './pipeline/dbPipelineBackup'
|
|
40
|
-
import { dbPipelineCopy, DBPipelineCopyOptions } from './pipeline/dbPipelineCopy'
|
|
41
|
-
import { dbPipelineRestore, DBPipelineRestoreOptions } from './pipeline/dbPipelineRestore'
|
|
42
|
-
import {
|
|
43
|
-
DBQuery,
|
|
44
|
-
DBQueryFilter,
|
|
45
|
-
DBQueryFilterOperator,
|
|
46
|
-
dbQueryFilterOperatorValues,
|
|
47
|
-
DBQueryOrder,
|
|
48
|
-
RunnableDBQuery,
|
|
49
|
-
} from './query/dbQuery'
|
|
50
|
-
import { DBTransaction, RunnableDBTransaction } from './transaction/dbTransaction'
|
|
51
|
-
import { commitDBTransactionSimple } from './transaction/dbTransaction.util'
|
|
1
|
+
export * from './adapter/inmemory/inMemory.db'
|
|
2
|
+
export * from './adapter/inmemory/inMemoryKeyValueDB'
|
|
3
|
+
export * from './adapter/inmemory/queryInMemory'
|
|
4
|
+
export * from './base.common.db'
|
|
5
|
+
export * from './cnst'
|
|
6
|
+
export * from './common.db'
|
|
7
|
+
export * from './commondao/common.dao'
|
|
8
|
+
export * from './commondao/common.dao.model'
|
|
9
|
+
export * from './db.model'
|
|
10
|
+
export * from './kv/commonKeyValueDao'
|
|
11
|
+
export * from './kv/commonKeyValueDB'
|
|
12
|
+
export * from './model.util'
|
|
13
|
+
export * from './pipeline/dbPipelineBackup'
|
|
14
|
+
export * from './pipeline/dbPipelineCopy'
|
|
15
|
+
export * from './pipeline/dbPipelineRestore'
|
|
16
|
+
export * from './query/dbQuery'
|
|
17
|
+
export * from './transaction/dbTransaction'
|
|
18
|
+
export * from './transaction/dbTransaction.util'
|
|
52
19
|
export * from './kv/commonKeyValueDaoMemoCache'
|
|
53
|
-
|
|
54
|
-
export type {
|
|
55
|
-
DBQueryFilterOperator,
|
|
56
|
-
DBQueryFilter,
|
|
57
|
-
DBQueryOrder,
|
|
58
|
-
CommonDaoCreateOptions,
|
|
59
|
-
CommonDaoOptions,
|
|
60
|
-
CommonDaoSaveOptions,
|
|
61
|
-
CommonDaoStreamForEachOptions,
|
|
62
|
-
CommonDaoStreamOptions,
|
|
63
|
-
CommonDaoHooks,
|
|
64
|
-
CommonDBOptions,
|
|
65
|
-
CommonDBSaveOptions,
|
|
66
|
-
CommonDBSaveMethod,
|
|
67
|
-
CommonDBStreamOptions,
|
|
68
|
-
CommonDBCreateOptions,
|
|
69
|
-
CommonDB,
|
|
70
|
-
RunQueryResult,
|
|
71
|
-
CommonDaoCfg,
|
|
72
|
-
InMemoryDBCfg,
|
|
73
|
-
InMemoryKeyValueDBCfg,
|
|
74
|
-
DBPipelineBackupOptions,
|
|
75
|
-
DBPipelineRestoreOptions,
|
|
76
|
-
DBPipelineCopyOptions,
|
|
77
|
-
DBOperation,
|
|
78
|
-
DBSaveBatchOperation,
|
|
79
|
-
DBDeleteByIdsOperation,
|
|
80
|
-
CommonKeyValueDB,
|
|
81
|
-
CommonKeyValueDaoCfg,
|
|
82
|
-
KeyValueDBTuple,
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export {
|
|
86
|
-
DBQuery,
|
|
87
|
-
dbQueryFilterOperatorValues,
|
|
88
|
-
RunnableDBQuery,
|
|
89
|
-
CommonDaoLogLevel,
|
|
90
|
-
DBRelation,
|
|
91
|
-
DBModelType,
|
|
92
|
-
CommonDao,
|
|
93
|
-
createdUpdatedFields,
|
|
94
|
-
createdUpdatedIdFields,
|
|
95
|
-
InMemoryDB,
|
|
96
|
-
InMemoryKeyValueDB,
|
|
97
|
-
queryInMemory,
|
|
98
|
-
serializeJsonField,
|
|
99
|
-
deserializeJsonField,
|
|
100
|
-
dbPipelineBackup,
|
|
101
|
-
dbPipelineRestore,
|
|
102
|
-
dbPipelineCopy,
|
|
103
|
-
DBLibError,
|
|
104
|
-
BaseCommonDB,
|
|
105
|
-
DBTransaction,
|
|
106
|
-
RunnableDBTransaction,
|
|
107
|
-
commitDBTransactionSimple,
|
|
108
|
-
CommonKeyValueDao,
|
|
109
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonDB } from '../common.db'
|
|
2
|
-
import { CommonDBSaveOptions } from '../db.model'
|
|
2
|
+
import { CommonDBSaveOptions, DBOperation } from '../db.model'
|
|
3
3
|
import { DBTransaction } from './dbTransaction'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -10,6 +10,10 @@ import { DBTransaction } from './dbTransaction'
|
|
|
10
10
|
* Currently only takes into account SaveBatch and DeleteByIds ops.
|
|
11
11
|
* Output ops are maximum 1 per entity - save or delete.
|
|
12
12
|
*/
|
|
13
|
+
export function mergeDBOperations(ops: DBOperation[]): DBOperation[] {
|
|
14
|
+
return ops // currently "does nothing"
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
// Commented out as "overly complicated"
|
|
14
18
|
/*
|
|
15
19
|
export function mergeDBOperations(ops: DBOperation[]): DBOperation[] {
|