@naturalcycles/mysql-lib 3.16.0 → 3.16.2

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.
@@ -1,5 +1,5 @@
1
1
  import { CommonDBCreateOptions, CommonKeyValueDB, KeyValueDBTuple } from '@naturalcycles/db-lib';
2
- import { StringMap } from '@naturalcycles/js-lib';
2
+ import { IncrementTuple } from '@naturalcycles/db-lib/dist/kv/commonKeyValueDB';
3
3
  import { ReadableTyped } from '@naturalcycles/nodejs-lib';
4
4
  import { MysqlDB, MysqlDBCfg } from './mysql.db';
5
5
  export declare class MySQLKeyValueDB implements CommonKeyValueDB {
@@ -26,6 +26,5 @@ export declare class MySQLKeyValueDB implements CommonKeyValueDB {
26
26
  beginTransaction(): Promise<void>;
27
27
  endTransaction(): Promise<void>;
28
28
  count(table: string): Promise<number>;
29
- increment(_table: string, _id: string, _by?: number): Promise<number>;
30
- incrementBatch(_table: string, _incrementMap: StringMap<number>): Promise<StringMap<number>>;
29
+ incrementBatch(_table: string, _entries: IncrementTuple[]): Promise<IncrementTuple[]>;
31
30
  }
@@ -101,10 +101,7 @@ class MySQLKeyValueDB {
101
101
  const rows = await this.db.runSQL({ sql });
102
102
  return rows[0].cnt;
103
103
  }
104
- async increment(_table, _id, _by) {
105
- throw new js_lib_1.AppError('MySQLKeyValueDB.increment() is not implemented');
106
- }
107
- async incrementBatch(_table, _incrementMap) {
104
+ async incrementBatch(_table, _entries) {
108
105
  throw new js_lib_1.AppError('MySQLKeyValueDB.incrementBatch() is not implemented');
109
106
  }
110
107
  }
package/package.json CHANGED
@@ -41,7 +41,7 @@
41
41
  "engines": {
42
42
  "node": ">=20.13.0"
43
43
  },
44
- "version": "3.16.0",
44
+ "version": "3.16.2",
45
45
  "description": "MySQL client implementing CommonDB interface",
46
46
  "keywords": [
47
47
  "mysql",
@@ -4,7 +4,8 @@ import {
4
4
  commonKeyValueDBFullSupport,
5
5
  KeyValueDBTuple,
6
6
  } from '@naturalcycles/db-lib'
7
- import { AppError, ObjectWithId, pMap, StringMap } from '@naturalcycles/js-lib'
7
+ import { IncrementTuple } from '@naturalcycles/db-lib/dist/kv/commonKeyValueDB'
8
+ import { AppError, ObjectWithId, pMap } from '@naturalcycles/js-lib'
8
9
  import { ReadableTyped } from '@naturalcycles/nodejs-lib'
9
10
  import { QueryOptions } from 'mysql'
10
11
  import { MysqlDB, MysqlDBCfg } from './mysql.db'
@@ -125,14 +126,7 @@ export class MySQLKeyValueDB implements CommonKeyValueDB {
125
126
  return rows[0]!.cnt
126
127
  }
127
128
 
128
- async increment(_table: string, _id: string, _by?: number): Promise<number> {
129
- throw new AppError('MySQLKeyValueDB.increment() is not implemented')
130
- }
131
-
132
- async incrementBatch(
133
- _table: string,
134
- _incrementMap: StringMap<number>,
135
- ): Promise<StringMap<number>> {
129
+ async incrementBatch(_table: string, _entries: IncrementTuple[]): Promise<IncrementTuple[]> {
136
130
  throw new AppError('MySQLKeyValueDB.incrementBatch() is not implemented')
137
131
  }
138
132
  }