xdriver 1.0.4 → 1.0.5
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/Table.d.ts +1 -0
- package/lib/Table.js +7 -0
- package/package.json +1 -1
package/lib/Table.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export default class Table {
|
|
|
22
22
|
keys(keyRange?: KeyRange, limit?: number): any;
|
|
23
23
|
count(keyRange?: KeyRange): any;
|
|
24
24
|
query(keyRange?: KeyRange, limit?: number): any;
|
|
25
|
+
select(where: any, options?: any): any;
|
|
25
26
|
queryByKey(key: any): any;
|
|
26
27
|
fetch(keyRange?: KeyRange, direction?: CursorDirection): Promise<unknown>;
|
|
27
28
|
queryByIndex(name: string, key: any, count?: number): any;
|
package/lib/Table.js
CHANGED
|
@@ -90,6 +90,13 @@ export default class Table {
|
|
|
90
90
|
const request = _getObjectStore(this).getAll(keyRange, limit);
|
|
91
91
|
return _request(request);
|
|
92
92
|
}
|
|
93
|
+
select(where, options) {
|
|
94
|
+
let { index = '', limit = void 0, useIndex = false } = options;
|
|
95
|
+
if (useIndex && index) {
|
|
96
|
+
return this.queryByIndex(index, where, limit);
|
|
97
|
+
}
|
|
98
|
+
return this.query(where, limit);
|
|
99
|
+
}
|
|
93
100
|
queryByKey(key) {
|
|
94
101
|
const request = _getObjectStore(this).get(key);
|
|
95
102
|
return _request(request);
|