rado 0.1.6 → 0.1.7
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/dist/Cursor.d.ts +1 -0
- package/dist/Cursor.js +3 -0
- package/dist/Driver.d.ts +3 -1
- package/dist/Driver.js +2 -0
- package/package.json +1 -1
package/dist/Cursor.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export declare namespace Cursor {
|
|
|
71
71
|
orderBy(...orderBy: Array<OrderBy>): SelectSingle<T>;
|
|
72
72
|
groupBy(...groupBy: Array<Expr<any>>): SelectSingle<T>;
|
|
73
73
|
where(...where: Array<EV<boolean>>): SelectSingle<T>;
|
|
74
|
+
all(): SelectMultiple<T>;
|
|
74
75
|
toExpr(): Expr<T>;
|
|
75
76
|
}
|
|
76
77
|
}
|
package/dist/Cursor.js
CHANGED
|
@@ -205,6 +205,9 @@ var Cursor = class {
|
|
|
205
205
|
where(...where) {
|
|
206
206
|
return new SelectSingle(super.where(...where).query());
|
|
207
207
|
}
|
|
208
|
+
all() {
|
|
209
|
+
return new SelectMultiple({ ...this.query(), singleResult: false });
|
|
210
|
+
}
|
|
208
211
|
toExpr() {
|
|
209
212
|
return new Expr(ExprData.Query(this.query()));
|
|
210
213
|
}
|
package/dist/Driver.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ declare abstract class SyncDriver extends DriverBase {
|
|
|
32
32
|
abstract schemaInstructions(tableName: string): SchemaInstructions | undefined;
|
|
33
33
|
migrateSchema(...tables: Array<Table<any>>): unknown;
|
|
34
34
|
executeQuery<T>(query: Query<T>): T;
|
|
35
|
+
all<T>(cursor: Cursor.SelectSingle<T>): Array<T>;
|
|
35
36
|
all<T>(cursor: Cursor<T>): Array<T>;
|
|
36
37
|
all<T>(strings: TemplateStringsArray, ...params: Array<any>): Array<T>;
|
|
37
38
|
get<T>(cursor: Cursor.SelectMultiple<T>): T | null;
|
|
@@ -57,7 +58,8 @@ declare abstract class AsyncDriver extends DriverBase {
|
|
|
57
58
|
abstract schemaInstructions(tableName: string): Promise<SchemaInstructions | undefined>;
|
|
58
59
|
migrateSchema(...tables: Array<Table<any>>): Promise<unknown>;
|
|
59
60
|
executeQuery<T>(query: Query<T>): Promise<T>;
|
|
60
|
-
all<T>(cursor: Cursor<T>): Promise<Array<T>>;
|
|
61
|
+
all<T>(cursor: Cursor.SelectSingle<T>): Promise<Array<T>>;
|
|
62
|
+
all<T>(cursor: Cursor<T>): Promise<T>;
|
|
61
63
|
all<T>(strings: TemplateStringsArray, ...params: Array<any>): Promise<Array<T>>;
|
|
62
64
|
get<T>(cursor: Cursor.SelectMultiple<T>): Promise<T | null>;
|
|
63
65
|
get<T>(cursor: Cursor<T>): Promise<T>;
|
package/dist/Driver.js
CHANGED
|
@@ -33,6 +33,8 @@ var DriverBase = class extends Callable {
|
|
|
33
33
|
}
|
|
34
34
|
all(...args) {
|
|
35
35
|
const [input, ...rest] = args;
|
|
36
|
+
if (input instanceof Cursor.SelectSingle)
|
|
37
|
+
return this.executeQuery(input.all().query());
|
|
36
38
|
if (input instanceof Cursor)
|
|
37
39
|
return this.executeQuery(input.query());
|
|
38
40
|
return this.executeTemplate("rows", input, ...rest);
|