@naturalcycles/db-lib
Advanced tools
Comparing version 9.14.1 to 9.14.2
@@ -51,17 +51,17 @@ import { JsonSchemaObject, StringMap, JsonSchemaRootObject, ObjectWithId, CommonLogger } from '@naturalcycles/js-lib'; | ||
support: { | ||
queries?: boolean | undefined; | ||
dbQueryFilter?: boolean | undefined; | ||
dbQueryFilterIn?: boolean | undefined; | ||
dbQueryOrder?: boolean | undefined; | ||
dbQuerySelectFields?: boolean | undefined; | ||
insertSaveMethod?: boolean | undefined; | ||
updateSaveMethod?: boolean | undefined; | ||
updateByQuery?: boolean | undefined; | ||
dbIncrement?: boolean | undefined; | ||
createTable?: boolean | undefined; | ||
tableSchemas?: boolean | undefined; | ||
streaming?: boolean | undefined; | ||
bufferValues?: boolean | undefined; | ||
nullValues?: boolean | undefined; | ||
transactions?: boolean | undefined; | ||
queries?: boolean; | ||
dbQueryFilter?: boolean; | ||
dbQueryFilterIn?: boolean; | ||
dbQueryOrder?: boolean; | ||
dbQuerySelectFields?: boolean; | ||
insertSaveMethod?: boolean; | ||
updateSaveMethod?: boolean; | ||
updateByQuery?: boolean; | ||
dbIncrement?: boolean; | ||
createTable?: boolean; | ||
tableSchemas?: boolean; | ||
streaming?: boolean; | ||
bufferValues?: boolean; | ||
nullValues?: boolean; | ||
transactions?: boolean; | ||
}; | ||
@@ -68,0 +68,0 @@ constructor(cfg?: Partial<InMemoryDBCfg>); |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import { StringMap } from '@naturalcycles/js-lib'; | ||
@@ -3,0 +2,0 @@ import { ReadableTyped } from '@naturalcycles/nodejs-lib'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.queryInMemory = void 0; | ||
exports.queryInMemory = queryInMemory; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -52,2 +52,1 @@ const FILTER_FNS = { | ||
} | ||
exports.queryInMemory = queryInMemory; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import { Transform } from 'node:stream'; | ||
@@ -3,0 +2,0 @@ import { AsyncMapper, BaseDBEntity, CommonLogger, JsonSchemaObject, JsonSchemaRootObject, UnixTimestampMillisNumber, Unsaved, ZodSchema } from '@naturalcycles/js-lib'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import { CommonLogger, KeyValueTuple } from '@naturalcycles/js-lib'; | ||
@@ -3,0 +2,0 @@ import { ReadableTyped } from '@naturalcycles/nodejs-lib'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import { UnixTimestampNumber } from '@naturalcycles/js-lib'; | ||
@@ -3,0 +2,0 @@ import { ReadableTyped } from '@naturalcycles/nodejs-lib'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.serializeJsonField = exports.deserializeJsonField = exports.createdUpdatedIdFields = exports.createdUpdatedFields = void 0; | ||
exports.createdUpdatedFields = createdUpdatedFields; | ||
exports.createdUpdatedIdFields = createdUpdatedIdFields; | ||
exports.deserializeJsonField = deserializeJsonField; | ||
exports.serializeJsonField = serializeJsonField; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -13,3 +16,2 @@ const nodejs_lib_1 = require("@naturalcycles/nodejs-lib"); | ||
} | ||
exports.createdUpdatedFields = createdUpdatedFields; | ||
function createdUpdatedIdFields(existingObject) { | ||
@@ -23,7 +25,5 @@ const now = (0, js_lib_1.nowUnix)(); | ||
} | ||
exports.createdUpdatedIdFields = createdUpdatedIdFields; | ||
function deserializeJsonField(f) { | ||
return JSON.parse(f || '{}'); | ||
} | ||
exports.deserializeJsonField = deserializeJsonField; | ||
function serializeJsonField(f) { | ||
@@ -34,2 +34,1 @@ if (f === undefined) | ||
} | ||
exports.serializeJsonField = serializeJsonField; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.dbPipelineBackup = void 0; | ||
exports.dbPipelineBackup = dbPipelineBackup; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -87,2 +87,1 @@ const nodejs_lib_1 = require("@naturalcycles/nodejs-lib"); | ||
} | ||
exports.dbPipelineBackup = dbPipelineBackup; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.dbPipelineCopy = void 0; | ||
exports.dbPipelineCopy = dbPipelineCopy; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -62,2 +62,1 @@ const nodejs_lib_1 = require("@naturalcycles/nodejs-lib"); | ||
} | ||
exports.dbPipelineCopy = dbPipelineCopy; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.dbPipelineRestore = void 0; | ||
exports.dbPipelineRestore = dbPipelineRestore; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -99,2 +99,1 @@ const nodejs_lib_1 = require("@naturalcycles/nodejs-lib"); | ||
} | ||
exports.dbPipelineRestore = dbPipelineRestore; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.runCommonDaoTest = void 0; | ||
exports.runCommonDaoTest = runCommonDaoTest; | ||
const node_stream_1 = require("node:stream"); | ||
@@ -231,2 +231,1 @@ const js_lib_1 = require("@naturalcycles/js-lib"); | ||
} | ||
exports.runCommonDaoTest = runCommonDaoTest; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.expectMatch = exports.runCommonDBTest = void 0; | ||
exports.runCommonDBTest = runCommonDBTest; | ||
exports.expectMatch = expectMatch; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -286,3 +287,2 @@ const common_db_1 = require("../common.db"); | ||
} | ||
exports.runCommonDBTest = runCommonDBTest; | ||
function expectMatch(expected, actual, quirks) { | ||
@@ -303,2 +303,1 @@ // const expectedSorted = sortObjectDeep(expected) | ||
} | ||
exports.expectMatch = expectMatch; |
@@ -1,3 +0,2 @@ | ||
/// <reference types="node" /> | ||
import { CommonKeyValueDao } from '../kv/commonKeyValueDao'; | ||
export declare function runCommonKeyValueDaoTest(dao: CommonKeyValueDao<Buffer>): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.runCommonKeyValueDaoTest = void 0; | ||
exports.runCommonKeyValueDaoTest = runCommonKeyValueDaoTest; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -67,2 +67,1 @@ const testIds = (0, js_lib_1._range)(1, 4).map(n => `id${n}`); | ||
} | ||
exports.runCommonKeyValueDaoTest = runCommonKeyValueDaoTest; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.runCommonKeyValueDBTest = void 0; | ||
exports.runCommonKeyValueDBTest = runCommonKeyValueDBTest; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -74,2 +74,1 @@ const test_model_1 = require("./test.model"); | ||
} | ||
exports.runCommonKeyValueDBTest = runCommonKeyValueDBTest; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import { BaseDBEntity, JsonSchemaObject } from '@naturalcycles/js-lib'; | ||
@@ -3,0 +2,0 @@ export declare const TEST_TABLE = "TEST_TABLE"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createTestItemsBM = exports.createTestItemsDBM = exports.createTestItemBM = exports.createTestItemDBM = exports.testItemBMJsonSchema = exports.testItemTMSchema = exports.testItemBMSchema = exports.TEST_TABLE = void 0; | ||
exports.testItemBMJsonSchema = exports.testItemTMSchema = exports.testItemBMSchema = exports.TEST_TABLE = void 0; | ||
exports.createTestItemDBM = createTestItemDBM; | ||
exports.createTestItemBM = createTestItemBM; | ||
exports.createTestItemsDBM = createTestItemsDBM; | ||
exports.createTestItemsBM = createTestItemsBM; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -44,14 +48,10 @@ const nodejs_lib_1 = require("@naturalcycles/nodejs-lib"); | ||
} | ||
exports.createTestItemDBM = createTestItemDBM; | ||
function createTestItemBM(num = 1) { | ||
return createTestItemDBM(num); | ||
} | ||
exports.createTestItemBM = createTestItemBM; | ||
function createTestItemsDBM(count = 1) { | ||
return (0, js_lib_1._range)(1, count + 1).map(num => createTestItemDBM(num)); | ||
} | ||
exports.createTestItemsDBM = createTestItemsDBM; | ||
function createTestItemsBM(count = 1) { | ||
return (0, js_lib_1._range)(1, count + 1).map(num => createTestItemBM(num)); | ||
} | ||
exports.createTestItemsBM = createTestItemsBM; |
"use strict"; | ||
// copy-pasted from test-lib to be able to not include devDependecies there | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deepFreeze = void 0; | ||
exports.deepFreeze = deepFreeze; | ||
/** | ||
@@ -24,2 +24,1 @@ * Does Object.freeze recursively for given object. | ||
} | ||
exports.deepFreeze = deepFreeze; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createTestTimeSeries = void 0; | ||
exports.createTestTimeSeries = createTestTimeSeries; | ||
const js_lib_1 = require("@naturalcycles/js-lib"); | ||
@@ -9,2 +9,1 @@ function createTestTimeSeries(count = 10) { | ||
} | ||
exports.createTestTimeSeries = createTestTimeSeries; |
@@ -43,3 +43,3 @@ { | ||
}, | ||
"version": "9.14.1", | ||
"version": "9.14.2", | ||
"description": "Lowest Common Denominator API to supported Databases", | ||
@@ -46,0 +46,0 @@ "keywords": [ |
@@ -218,3 +218,3 @@ import { Readable } from 'node:stream' | ||
if (!this.data[table]) return 0 | ||
const ids = queryInMemory(q, Object.values(this.data[table]!) as ROW[]).map(r => r.id) | ||
const ids = queryInMemory(q, Object.values(this.data[table]) as ROW[]).map(r => r.id) | ||
return await this.deleteByIds(q.table, ids) | ||
@@ -221,0 +221,0 @@ } |
@@ -48,4 +48,4 @@ import { Readable } from 'node:stream' | ||
this.data[table] ||= {} | ||
return Object.keys(this.data[table]!).length | ||
return Object.keys(this.data[table]).length | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
414525
10930