Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit ee5cd1e

Browse files
fix: adapt to db-lib
1 parent 9325445 commit ee5cd1e

File tree

3 files changed

+160
-168
lines changed

3 files changed

+160
-168
lines changed

src/betterSqliteKeyValueDB.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import {
22
CommonDBCreateOptions,
33
CommonKeyValueDB,
44
commonKeyValueDBFullSupport,
5+
IncrementTuple,
56
KeyValueDBTuple,
67
} from '@naturalcycles/db-lib'
7-
import { AppError, CommonLogger, StringMap } from '@naturalcycles/js-lib'
8+
import { AppError, CommonLogger } from '@naturalcycles/js-lib'
89
import { boldWhite, readableCreate, ReadableTyped } from '@naturalcycles/nodejs-lib'
910
import type { Database, Options } from 'better-sqlite3'
1011
import BetterSqlite3 from 'better-sqlite3'
@@ -207,10 +208,7 @@ export class BetterSqliteKeyValueDB implements CommonKeyValueDB {
207208
throw new AppError('Not implemented')
208209
}
209210

210-
async incrementBatch(
211-
_table: string,
212-
_incrementMap: StringMap<number>,
213-
): Promise<StringMap<number>> {
211+
async incrementBatch(_table: string, _entries: IncrementTuple[]): Promise<IncrementTuple[]> {
214212
throw new AppError('Not implemented')
215213
}
216214
}

src/sqliteKeyValueDB.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import {
22
CommonDBCreateOptions,
33
CommonKeyValueDB,
44
commonKeyValueDBFullSupport,
5+
IncrementTuple,
56
KeyValueDBTuple,
67
} from '@naturalcycles/db-lib'
7-
import { AppError, CommonLogger, pMap, StringMap } from '@naturalcycles/js-lib'
8+
import { AppError, CommonLogger, pMap } from '@naturalcycles/js-lib'
89
import { boldWhite, readableCreate, ReadableTyped } from '@naturalcycles/nodejs-lib'
910
import { Database, open } from 'sqlite'
1011
import * as sqlite3 from 'sqlite3'
@@ -226,14 +227,7 @@ export class SqliteKeyValueDB implements CommonKeyValueDB {
226227
return cnt
227228
}
228229

229-
async increment(_table: string, _id: string, _by?: number): Promise<number> {
230-
throw new AppError('Not implemented')
231-
}
232-
233-
async incrementBatch(
234-
_table: string,
235-
_incrementMap: StringMap<number>,
236-
): Promise<StringMap<number>> {
230+
async incrementBatch(_table: string, _entries: IncrementTuple[]): Promise<IncrementTuple[]> {
237231
throw new AppError('Not implemented')
238232
}
239233
}

0 commit comments

Comments
 (0)