xdriver 1.0.10 → 1.0.11

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.
package/lib/Driver.d.ts CHANGED
@@ -2,7 +2,8 @@ import { KeyRange } from "./Const";
2
2
  import Database from "./Database";
3
3
  declare class Driver extends Database {
4
4
  insert(table: string, data: Array<any>): Promise<unknown>;
5
- select(table: string, keyRange?: KeyRange, limit?: number): any;
5
+ query(table: string, keyRange?: KeyRange, limit?: number): any;
6
+ select(table: string, where: any, options?: any): any;
6
7
  selectByKey(table: string, key: any): any;
7
8
  count(table: string, keyRange?: KeyRange): any;
8
9
  update(table: string, modify: any, where: any): Promise<unknown> | undefined;
package/lib/Driver.js CHANGED
@@ -3,9 +3,12 @@ class Driver extends Database {
3
3
  insert(table, data) {
4
4
  return this.table(table).insert(data);
5
5
  }
6
- select(table, keyRange, limit) {
6
+ query(table, keyRange, limit) {
7
7
  return this.table(table).query(keyRange, limit);
8
8
  }
9
+ select(table, where, options) {
10
+ return this.table(table).select(where, options);
11
+ }
9
12
  selectByKey(table, key) {
10
13
  return this.table(table).queryByKey(key);
11
14
  }
package/lib/Table.js CHANGED
@@ -107,7 +107,7 @@ export default class Table {
107
107
  if (!where) {
108
108
  return this.query();
109
109
  }
110
- let { index = '', limit = void 0, useIndex = false } = options;
110
+ let { index = '', limit = void 0, useIndex = false } = options || {};
111
111
  if (useIndex && index) {
112
112
  return this.queryByIndex(index, where, limit);
113
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xdriver",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "A simple driver for IndexDB",
5
5
  "main": "./lib/index",
6
6
  "files": [