rado 0.1.4 → 0.1.6

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 CHANGED
@@ -6,8 +6,7 @@ import { Selection } from './Selection';
6
6
  import { Table } from './Table';
7
7
  import { Update as UpdateSet } from './Update';
8
8
  export declare class Cursor<T> {
9
- /** @internal */
10
- protected __cursorType: T;
9
+ [Selection.__cursorType](): T;
11
10
  constructor(query: Query<T>);
12
11
  query(): Query<T>;
13
12
  toJSON(): Query<T>;
package/dist/Cursor.js CHANGED
@@ -3,8 +3,12 @@ import { Expr, ExprData } from "./Expr.js";
3
3
  import { Functions } from "./Functions.js";
4
4
  import { Query } from "./Query.js";
5
5
  import { Schema } from "./Schema.js";
6
+ import { Selection } from "./Selection.js";
6
7
  import { Target } from "./Target.js";
7
8
  var Cursor = class {
9
+ [Selection.__cursorType]() {
10
+ throw "assert";
11
+ }
8
12
  constructor(query) {
9
13
  Object.defineProperty(this, "query", {
10
14
  enumerable: false,
package/dist/Driver.d.ts CHANGED
@@ -42,7 +42,7 @@ declare abstract class SyncDriver extends DriverBase {
42
42
  }
43
43
  interface AsyncDriver {
44
44
  <T>(query: Cursor<T>): Promise<T>;
45
- <T>(...queries: Array<Cursor<any>>): T;
45
+ <T>(...queries: Array<Cursor<any>>): Promise<T>;
46
46
  (strings: TemplateStringsArray, ...values: any[]): Promise<any>;
47
47
  }
48
48
  declare abstract class AsyncDriver extends DriverBase {
@@ -5,10 +5,12 @@ interface SelectionRecord extends Record<string, Selection> {
5
5
  }
6
6
  export type Selection = SelectionBase | SelectionRecord;
7
7
  export declare namespace Selection {
8
+ const __tableType: unique symbol;
9
+ const __cursorType: unique symbol;
8
10
  type Infer<T> = T extends {
9
- __tableType: infer K;
11
+ [__tableType](): infer K;
10
12
  } ? K : T extends {
11
- __cursortype: infer K;
13
+ [__cursorType](): infer K;
12
14
  } ? K : T extends Expr<infer K> ? K : T extends Record<string, Selection> ? {
13
15
  [K in keyof T]: Infer<T[K]>;
14
16
  } : T;
package/dist/Selection.js CHANGED
@@ -0,0 +1,7 @@
1
+ // src/Selection.ts
2
+ var Selection;
3
+ ((Selection2) => {
4
+ })(Selection || (Selection = {}));
5
+ export {
6
+ Selection
7
+ };
package/dist/Table.d.ts CHANGED
@@ -3,10 +3,10 @@ import { Cursor } from './Cursor';
3
3
  import { Expr } from './Expr';
4
4
  import { Fields } from './Fields';
5
5
  import { Schema } from './Schema';
6
+ import { Selection } from './Selection';
6
7
  import { Update } from './Update';
7
8
  export declare class Table<T> extends Cursor.SelectMultiple<T> {
8
- /** @internal */
9
- protected __tableType: T;
9
+ [Selection.__tableType](): T;
10
10
  constructor(schema: Schema);
11
11
  insertOne(record: Table.Insert<T>): Cursor.Batch<T>;
12
12
  insertAll(data: Array<Table.Insert<T>>): Cursor.InsertValues;
package/dist/Table.js CHANGED
@@ -2,8 +2,12 @@
2
2
  import { Cursor } from "./Cursor.js";
3
3
  import { Expr, ExprData } from "./Expr.js";
4
4
  import { Query } from "./Query.js";
5
+ import { Selection } from "./Selection.js";
5
6
  import { Target } from "./Target.js";
6
7
  var Table = class extends Cursor.SelectMultiple {
8
+ [Selection.__tableType]() {
9
+ throw "assert";
10
+ }
7
11
  constructor(schema) {
8
12
  super(
9
13
  Query.Select({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {