rado 0.1.31 → 0.1.33
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/lib/Selection.d.ts +3 -3
- package/dist/lib/Table.d.ts +3 -0
- package/dist/lib/Table.js +3 -0
- package/package.json +1 -1
package/dist/lib/Selection.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Cursor } from './Cursor';
|
|
2
2
|
import type { Expr } from './Expr';
|
|
3
|
-
type SelectionBase = Expr<any> | Cursor.SelectMultiple<any> | Cursor.SelectSingle<any>;
|
|
3
|
+
type SelectionBase = (() => any) | Expr<any> | Cursor.SelectMultiple<any> | Cursor.SelectSingle<any>;
|
|
4
4
|
interface SelectionRecord extends Record<string, Selection> {
|
|
5
5
|
}
|
|
6
6
|
export type Selection = SelectionBase | SelectionRecord;
|
|
@@ -12,8 +12,8 @@ export declare namespace Selection {
|
|
|
12
12
|
} ? K : T extends {
|
|
13
13
|
[__cursorType](): infer K;
|
|
14
14
|
} ? K : T extends Expr<infer K> ? K : T extends Record<string, Selection> ? {
|
|
15
|
-
[K in keyof T]: Infer<T[K]>;
|
|
16
|
-
} : T;
|
|
15
|
+
[K in keyof T as T[K] extends () => any ? never : K]: Infer<T[K]>;
|
|
16
|
+
} : T extends () => any ? never : T;
|
|
17
17
|
type With<A, B> = Expr<Combine<A, B>>;
|
|
18
18
|
type Combine<A, B> = Omit<A, keyof Infer<B>> & Infer<B>;
|
|
19
19
|
}
|
package/dist/lib/Table.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ import { Update } from './Update';
|
|
|
9
9
|
export declare class Table<T> extends Cursor.SelectMultiple<Table.Normalize<T>> {
|
|
10
10
|
[Selection.__tableType](): Table.Normalize<T>;
|
|
11
11
|
constructor(schema: Schema);
|
|
12
|
+
fetch(id: EV<T extends {
|
|
13
|
+
id: Column.IsPrimary<infer V, any>;
|
|
14
|
+
} ? V : never>): Cursor.SelectSingle<Table.Normalize<T> | undefined>;
|
|
12
15
|
insertOne(record: Table.Insert<T>): Cursor<Table.Normalize<T>>;
|
|
13
16
|
insertAll(data: Array<Table.Insert<T>>): Cursor.InsertValues;
|
|
14
17
|
set(data: Update<Table.Normalize<T>>): Cursor.Update<Table.Normalize<T>>;
|
package/dist/lib/Table.js
CHANGED