oak-db 3.0.4 → 3.1.0

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.
@@ -7,6 +7,7 @@ import { MySqlTranslator, MySqlSelectOption, MysqlOperateOption } from './transl
7
7
  import { AsyncContext, AsyncRowStore } from 'oak-domain/lib/store/AsyncRowStore';
8
8
  import { SyncContext } from 'oak-domain/lib/store/SyncRowStore';
9
9
  export declare class MysqlStore<ED extends EntityDict & BaseEntityDict, Cxt extends AsyncContext<ED>> extends CascadeStore<ED> implements AsyncRowStore<ED, Cxt> {
10
+ protected countAbjointRow<T extends keyof ED, OP extends SelectOption, Cxt extends SyncContext<ED>>(entity: T, selection: Pick<ED[T]['Selection'], 'filter' | 'count'>, context: Cxt, option: OP): number;
10
11
  protected aggregateAbjointRowSync<T extends keyof ED, OP extends SelectOption, Cxt extends SyncContext<ED>>(entity: T, aggregation: ED[T]['Aggregation'], context: Cxt, option: OP): AggregationResult<ED[T]['Schema']>;
11
12
  protected selectAbjointRow<T extends keyof ED, OP extends SelectOption>(entity: T, selection: ED[T]['Selection'], context: SyncContext<ED>, option: OP): Partial<ED[T]['Schema']>[];
12
13
  protected updateAbjointRow<T extends keyof ED, OP extends OperateOption>(entity: T, operation: ED[T]['Operation'], context: SyncContext<ED>, option: OP): number;
@@ -23,7 +24,7 @@ export declare class MysqlStore<ED extends EntityDict & BaseEntityDict, Cxt exte
23
24
  protected updateAbjointRowAsync<T extends keyof ED>(entity: T, operation: ED[T]['Operation'], context: AsyncContext<ED>, option?: MysqlOperateOption): Promise<number>;
24
25
  operate<T extends keyof ED>(entity: T, operation: ED[T]['Operation'], context: Cxt, option: OperateOption): Promise<OperationResult<ED>>;
25
26
  select<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt, option: SelectOption): Promise<Partial<ED[T]['Schema']>[]>;
26
- protected countAsync<T extends keyof ED>(entity: T, selection: Pick<ED[T]['Selection'], 'filter' | 'count'>, context: AsyncContext<ED>, option: SelectOption): Promise<number>;
27
+ protected countAbjointRowAsync<T extends keyof ED>(entity: T, selection: Pick<ED[T]['Selection'], 'filter' | 'count'>, context: AsyncContext<ED>, option: SelectOption): Promise<number>;
27
28
  count<T extends keyof ED>(entity: T, selection: Pick<ED[T]['Selection'], 'filter' | 'count'>, context: Cxt, option: SelectOption): Promise<number>;
28
29
  begin(option?: TxnOption): Promise<string>;
29
30
  commit(txnId: string): Promise<void>;
@@ -21,6 +21,9 @@ function convertGeoTextToObject(geoText) {
21
21
  }
22
22
  }
23
23
  class MysqlStore extends CascadeStore_1.CascadeStore {
24
+ countAbjointRow(entity, selection, context, option) {
25
+ throw new Error('MySQL store不支持同步取数据,不应该跑到这儿');
26
+ }
24
27
  aggregateAbjointRowSync(entity, aggregation, context, option) {
25
28
  throw new Error('MySQL store不支持同步取数据,不应该跑到这儿');
26
29
  }
@@ -264,7 +267,7 @@ class MysqlStore extends CascadeStore_1.CascadeStore {
264
267
  const result = await super.selectAsync(entity, selection, context, option);
265
268
  return result;
266
269
  }
267
- async countAsync(entity, selection, context, option) {
270
+ async countAbjointRowAsync(entity, selection, context, option) {
268
271
  const sql = this.translator.translateCount(entity, selection, option);
269
272
  const result = await this.connector.exec(sql, context.getCurrentTxnId());
270
273
  return result[0].cnt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-db",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
4
4
  "description": "oak-db",
5
5
  "main": "lib/index",
6
6
  "author": {
@@ -18,7 +18,7 @@
18
18
  "lodash": "^4.17.21",
19
19
  "mysql": "^2.18.1",
20
20
  "mysql2": "^2.3.3",
21
- "oak-domain": "^4.0.1",
21
+ "oak-domain": "^4.0.2",
22
22
  "uuid": "^8.3.2"
23
23
  },
24
24
  "license": "ISC",
@@ -31,7 +31,7 @@
31
31
  "@types/uuid": "^8.3.4",
32
32
  "cross-env": "^7.0.3",
33
33
  "mocha": "^10.2.0",
34
- "oak-general-business": "^4.0.2",
34
+ "oak-general-business": "^4.0.3",
35
35
  "ts-node": "^10.9.1",
36
36
  "tslib": "^2.4.0",
37
37
  "typescript": "^5.2.2"