Skip to content

Commit

Permalink
feat: deps, CommonKeyValueDB increment to throw as not implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Oct 2, 2024
1 parent 78042db commit 986917e
Show file tree
Hide file tree
Showing 5 changed files with 637 additions and 656 deletions.
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
"extends": ["node_modules/@naturalcycles/dev-lib/cfg/biome.jsonc"]
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@naturalcycles/nodejs-lib": "^13.1.0"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@naturalcycles/dev-lib": "^15.2.0",
"@types/node": "^22.0.0",
"jest": "^29.0.3"
Expand Down
10 changes: 3 additions & 7 deletions src/datastore.db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,24 +571,20 @@ export class DatastoreDBTransaction implements DBTransaction {
async getByIds<ROW extends ObjectWithId>(
table: string,
ids: string[],
opt?: CommonDBOptions | undefined,
opt?: CommonDBOptions,
): Promise<ROW[]> {
return await this.db.getByIds(table, ids, { ...opt, tx: this })
}

async saveBatch<ROW extends ObjectWithId>(
table: string,
rows: ROW[],
opt?: CommonDBSaveOptions<ROW> | undefined,
opt?: CommonDBSaveOptions<ROW>,
): Promise<void> {
await this.db.saveBatch(table, rows, { ...opt, tx: this })
}

async deleteByIds(
table: string,
ids: string[],
opt?: CommonDBOptions | undefined,
): Promise<number> {
async deleteByIds(table: string, ids: string[], opt?: CommonDBOptions): Promise<number> {
return await this.db.deleteByIds(table, ids, { ...opt, tx: this })
}
}
5 changes: 5 additions & 0 deletions src/datastoreKeyValueDB.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CommonKeyValueDB, DBQuery, KeyValueDBTuple } from '@naturalcycles/db-lib'
import { AppError } from '@naturalcycles/js-lib'
import { ReadableTyped } from '@naturalcycles/nodejs-lib'
import { DatastoreDB } from './datastore.db'
import { DatastoreDBCfg } from './datastore.model'
Expand Down Expand Up @@ -83,4 +84,8 @@ export class DatastoreKeyValueDB implements CommonKeyValueDB {
const q = DBQuery.create<KVObject>(table)
return await this.db.runQueryCount(q)
}

async increment(_table: string, _id: string, _by?: number): Promise<number> {
throw new AppError('DatastoreKeyValueDB.increment() is not implemented')
}
}
Loading

0 comments on commit 986917e

Please sign in to comment.