rado 0.2.31 → 0.2.32

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.
Files changed (72) hide show
  1. package/dist/define/Column.d.ts +3 -3
  2. package/dist/define/Column.js +13 -14
  3. package/dist/define/Expr.d.ts +10 -10
  4. package/dist/define/Expr.js +3 -4
  5. package/dist/define/Fields.d.ts +1 -1
  6. package/dist/define/Functions.d.ts +1 -1
  7. package/dist/define/Functions.js +1 -2
  8. package/dist/define/Index.d.ts +1 -1
  9. package/dist/define/Index.js +2 -3
  10. package/dist/define/Ops.d.ts +11 -11
  11. package/dist/define/Ops.js +3 -4
  12. package/dist/define/OrderBy.d.ts +1 -1
  13. package/dist/define/OrderBy.js +0 -1
  14. package/dist/define/Param.js +0 -1
  15. package/dist/define/Query.d.ts +9 -9
  16. package/dist/define/Query.js +3 -4
  17. package/dist/define/Schema.d.ts +3 -3
  18. package/dist/define/Schema.js +0 -1
  19. package/dist/define/Selection.d.ts +3 -3
  20. package/dist/define/Selection.js +0 -1
  21. package/dist/define/Sql.d.ts +1 -1
  22. package/dist/define/Sql.js +0 -1
  23. package/dist/define/Table.d.ts +9 -9
  24. package/dist/define/Table.js +3 -4
  25. package/dist/define/Target.d.ts +3 -3
  26. package/dist/define/Target.js +0 -1
  27. package/dist/define/VirtualTable.d.ts +11 -11
  28. package/dist/define/VirtualTable.js +1 -2
  29. package/dist/define/query/Batch.d.ts +1 -1
  30. package/dist/define/query/Batch.js +2 -3
  31. package/dist/define/query/CreateTable.d.ts +2 -2
  32. package/dist/define/query/CreateTable.js +2 -3
  33. package/dist/define/query/Delete.d.ts +2 -2
  34. package/dist/define/query/Delete.js +2 -3
  35. package/dist/define/query/Insert.d.ts +5 -5
  36. package/dist/define/query/Insert.js +6 -7
  37. package/dist/define/query/Select.d.ts +31 -31
  38. package/dist/define/query/Select.js +28 -31
  39. package/dist/define/query/TableSelect.d.ts +11 -11
  40. package/dist/define/query/TableSelect.js +3 -4
  41. package/dist/define/query/Union.d.ts +9 -9
  42. package/dist/define/query/Union.js +7 -8
  43. package/dist/define/query/Update.d.ts +3 -3
  44. package/dist/define/query/Update.js +2 -3
  45. package/dist/driver/better-sqlite3.d.ts +4 -4
  46. package/dist/driver/better-sqlite3.js +4 -5
  47. package/dist/driver/bun-sqlite.d.ts +4 -4
  48. package/dist/driver/bun-sqlite.js +6 -7
  49. package/dist/driver/sql.js.d.ts +4 -4
  50. package/dist/driver/sql.js.js +4 -5
  51. package/dist/driver/sqlite3.d.ts +5 -5
  52. package/dist/driver/sqlite3.js +4 -5
  53. package/dist/index.d.ts +21 -21
  54. package/dist/index.js +0 -1
  55. package/dist/lib/Driver.d.ts +10 -10
  56. package/dist/lib/Driver.js +10 -11
  57. package/dist/lib/Formatter.d.ts +7 -7
  58. package/dist/lib/Formatter.js +5 -6
  59. package/dist/lib/SqlError.js +2 -3
  60. package/dist/lib/Statement.d.ts +2 -2
  61. package/dist/lib/Statement.js +6 -7
  62. package/dist/sqlite/SqliteFormatter.d.ts +3 -3
  63. package/dist/sqlite/SqliteFormatter.js +8 -9
  64. package/dist/sqlite/SqliteFunctions.d.ts +3 -3
  65. package/dist/sqlite/SqliteFunctions.js +2 -3
  66. package/dist/sqlite/SqliteSchema.d.ts +3 -3
  67. package/dist/sqlite/SqliteSchema.js +0 -1
  68. package/dist/sqlite.d.ts +2 -2
  69. package/dist/sqlite.js +0 -1
  70. package/dist/util/Alias.js +0 -1
  71. package/dist/util/Callable.js +3 -4
  72. package/package.json +16 -5
@@ -1,6 +1,6 @@
1
- import { Callable } from '../util/Callable';
2
- import { EV, Expr, ExprData } from './Expr';
3
- import { Fields } from './Fields';
1
+ import { Callable } from '../util/Callable.js';
2
+ import { EV, Expr, ExprData } from './Expr.js';
3
+ import { Fields } from './Fields.js';
4
4
  export declare enum ColumnType {
5
5
  String = "String",
6
6
  Integer = "Integer",
@@ -1,4 +1,3 @@
1
- // src/define/Column.ts
2
1
  import { Callable } from "../util/Callable.js";
3
2
  import { Expr, ExprData } from "./Expr.js";
4
3
  var ColumnType = /* @__PURE__ */ ((ColumnType2) => {
@@ -18,7 +17,7 @@ var Column;
18
17
  }
19
18
  Column2.isColumn = isColumn;
20
19
  })(Column || (Column = {}));
21
- var ValueColumn = class extends Callable {
20
+ class ValueColumn extends Callable {
22
21
  [Column.Data];
23
22
  constructor(data) {
24
23
  super(() => this);
@@ -54,17 +53,17 @@ var ValueColumn = class extends Callable {
54
53
  defaultValue: createDefaultValue(value)
55
54
  });
56
55
  }
57
- };
56
+ }
58
57
  function createDefaultValue(value) {
59
58
  return typeof value === "function" && !Expr.isExpr(value) ? () => ExprData.create(value()) : ExprData.create(value);
60
59
  }
61
- var OptionalColumn = class extends ValueColumn {
60
+ class OptionalColumn extends ValueColumn {
62
61
  [Column.IsOptional];
63
- };
64
- var PrimaryColumn = class extends ValueColumn {
62
+ }
63
+ class PrimaryColumn extends ValueColumn {
65
64
  [Column.IsPrimary];
66
- };
67
- var ObjectColumn = class extends Callable {
65
+ }
66
+ class ObjectColumn extends Callable {
68
67
  [Column.Data];
69
68
  constructor(data) {
70
69
  super(() => this);
@@ -82,11 +81,11 @@ var ObjectColumn = class extends Callable {
82
81
  defaultValue: createDefaultValue(value)
83
82
  });
84
83
  }
85
- };
86
- var OptionalObjectColumn = class extends ObjectColumn {
84
+ }
85
+ class OptionalObjectColumn extends ObjectColumn {
87
86
  [Column.IsOptional];
88
- };
89
- var UnTyped = class extends Callable {
87
+ }
88
+ class UnTyped extends Callable {
90
89
  [Column.Data];
91
90
  constructor(data = {}) {
92
91
  super((name) => {
@@ -145,8 +144,8 @@ var UnTyped = class extends Callable {
145
144
  type: "Json" /* Json */
146
145
  });
147
146
  }
148
- };
149
- var column = new UnTyped();
147
+ }
148
+ const column = new UnTyped();
150
149
  export {
151
150
  Column,
152
151
  ColumnType,
@@ -1,10 +1,10 @@
1
- import { Fields } from './Fields';
2
- import { OrderBy } from './OrderBy';
3
- import { ParamData } from './Param';
4
- import { QueryData } from './Query';
5
- import { Selection } from './Selection';
6
- import { Target } from './Target';
7
- import { SelectMultiple, SelectSingle } from './query/Select';
1
+ import { Fields } from './Fields.js';
2
+ import { OrderBy } from './OrderBy.js';
3
+ import { ParamData } from './Param.js';
4
+ import { QueryData } from './Query.js';
5
+ import { Selection } from './Selection.js';
6
+ import { Target } from './Target.js';
7
+ import { Select, SelectFirst } from './query/Select.js';
8
8
  export declare enum UnOpType {
9
9
  Not = "Not",
10
10
  IsNull = "IsNull"
@@ -127,13 +127,13 @@ export declare class Expr<T> {
127
127
  not(): Expr<boolean>;
128
128
  or(this: Expr<boolean>, that: EV<boolean>): Expr<boolean>;
129
129
  and(this: Expr<boolean>, that: EV<boolean>): Expr<boolean>;
130
- is(that: EV<T> | SelectSingle<T>): Expr<boolean>;
130
+ is(that: EV<T> | SelectFirst<T>): Expr<boolean>;
131
131
  isConstant(value: T): boolean;
132
132
  isNot(that: EV<T>): Expr<boolean>;
133
133
  isNull(): Expr<boolean>;
134
134
  isNotNull(): Expr<boolean>;
135
- isIn(that: EV<Array<T>> | SelectMultiple<T>): Expr<boolean>;
136
- isNotIn(that: EV<Array<T>> | SelectMultiple<T>): Expr<boolean>;
135
+ isIn(that: EV<Array<T>> | Select<T>): Expr<boolean>;
136
+ isNotIn(that: EV<Array<T>> | Select<T>): Expr<boolean>;
137
137
  isGreater(that: EV<any>): Expr<boolean>;
138
138
  isGreaterOrEqual(that: EV<any>): Expr<boolean>;
139
139
  isLess(that: EV<any>): Expr<boolean>;
@@ -1,9 +1,8 @@
1
- // src/define/Expr.ts
2
1
  import { randomAlias } from "../util/Alias.js";
3
2
  import { OrderDirection } from "./OrderBy.js";
4
3
  import { ParamData, ParamType } from "./Param.js";
5
4
  import { Target } from "./Target.js";
6
- var { fromEntries, entries } = Object;
5
+ const { fromEntries, entries } = Object;
7
6
  var UnOpType = /* @__PURE__ */ ((UnOpType2) => {
8
7
  UnOpType2["Not"] = "Not";
9
8
  UnOpType2["IsNull"] = "IsNull";
@@ -149,7 +148,7 @@ var ExprData;
149
148
  }
150
149
  ExprData2.create = create;
151
150
  })(ExprData || (ExprData = {}));
152
- var Expr = class {
151
+ class Expr {
153
152
  constructor(expr) {
154
153
  this[Expr.Data] = expr;
155
154
  this[Expr.IsExpr] = true;
@@ -387,7 +386,7 @@ var Expr = class {
387
386
  get(name) {
388
387
  return new Expr(new ExprData.Field(this[Expr.Data], name));
389
388
  }
390
- };
389
+ }
391
390
  ((Expr2) => {
392
391
  Expr2.Data = Symbol("Expr.Data");
393
392
  Expr2.IsExpr = Symbol("Expr.IsExpr");
@@ -1,4 +1,4 @@
1
- import { Expr } from './Expr';
1
+ import { Expr } from './Expr.js';
2
2
  type ObjectUnion<T> = {
3
3
  [K in T extends infer P ? keyof P : never]: T extends infer P ? K extends keyof P ? P[K] : never : never;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { Expr } from './Expr';
1
+ import { Expr } from './Expr.js';
2
2
  export declare const Functions: Functions;
3
3
  export type Functions = {
4
4
  [key: string]: (...args: Array<any>) => Expr<any>;
@@ -1,4 +1,3 @@
1
- // src/define/Functions.ts
2
1
  import { Expr, ExprData } from "./Expr.js";
3
2
  function get(target, method) {
4
3
  if (method in target)
@@ -7,7 +6,7 @@ function get(target, method) {
7
6
  return new Expr(new ExprData.Call(method, args.map(ExprData.create)));
8
7
  };
9
8
  }
10
- var Functions = new Proxy(/* @__PURE__ */ Object.create(null), { get });
9
+ const Functions = new Proxy(/* @__PURE__ */ Object.create(null), { get });
11
10
  export {
12
11
  Functions
13
12
  };
@@ -1,4 +1,4 @@
1
- import { Expr, ExprData } from './Expr';
1
+ import { Expr, ExprData } from './Expr.js';
2
2
  interface PartialIndexData {
3
3
  on: Array<ExprData>;
4
4
  unique?: boolean;
@@ -1,6 +1,5 @@
1
- // src/define/Index.ts
2
1
  import { ExprData } from "./Expr.js";
3
- var Index = class {
2
+ class Index {
4
3
  constructor(data) {
5
4
  this.data = data;
6
5
  }
@@ -10,7 +9,7 @@ var Index = class {
10
9
  where(where) {
11
10
  return new Index({ ...this.data, where: ExprData.create(where) });
12
11
  }
13
- };
12
+ }
14
13
  function index(...on) {
15
14
  return new Index({ on: on.map(ExprData.create) });
16
15
  }
@@ -1,15 +1,15 @@
1
- import { Selection } from './Selection';
2
- import { Table } from './Table';
3
- import { Batch } from './query/Batch';
4
- import { Delete } from './query/Delete';
5
- import { Insert } from './query/Insert';
6
- import { SelectMultiple } from './query/Select';
7
- import { RecursiveUnion } from './query/Union';
8
- import { Update } from './query/Update';
9
- export declare function withRecursive<Row>(initialSelect: SelectMultiple<Row>): RecursiveUnion<Row>;
1
+ import { Selection } from './Selection.js';
2
+ import { Table } from './Table.js';
3
+ import { Batch } from './query/Batch.js';
4
+ import { Delete } from './query/Delete.js';
5
+ import { Insert } from './query/Insert.js';
6
+ import { Select } from './query/Select.js';
7
+ import { RecursiveUnion } from './query/Union.js';
8
+ import { Update } from './query/Update.js';
9
+ export declare function withRecursive<Row>(initialSelect: Select<Row>): RecursiveUnion<Row>;
10
10
  export declare function alias<T extends Table<{}>>(table: T): Record<string, T>;
11
- export declare function select<X extends Selection>(selection: X): SelectMultiple<Selection.Infer<X>>;
12
- export declare function from<Row>(source: Table<Row> | SelectMultiple<Row>): SelectMultiple<Row>;
11
+ export declare function select<X extends Selection>(selection: X): Select<Selection.Infer<X>>;
12
+ export declare function from<Row>(source: Table<Row> | Select<Row>): Select<Row>;
13
13
  export declare function update<Row>(table: Table<Row>): Update<Row>;
14
14
  export declare function insertInto<Row>(table: Table<Row>): Insert<Row>;
15
15
  export declare function deleteFrom<Row>(table: Table<Row>): Delete;
@@ -1,4 +1,3 @@
1
- // src/define/Ops.ts
2
1
  import { ExprData } from "./Expr.js";
3
2
  import { Query, QueryData } from "./Query.js";
4
3
  import { Schema } from "./Schema.js";
@@ -7,7 +6,7 @@ import { Target } from "./Target.js";
7
6
  import { Batch } from "./query/Batch.js";
8
7
  import { Delete } from "./query/Delete.js";
9
8
  import { Insert } from "./query/Insert.js";
10
- import { SelectMultiple } from "./query/Select.js";
9
+ import { Select } from "./query/Select.js";
11
10
  import { RecursiveUnion } from "./query/Union.js";
12
11
  import { Update } from "./query/Update.js";
13
12
  function withRecursive(initialSelect) {
@@ -21,7 +20,7 @@ function alias(table) {
21
20
  });
22
21
  }
23
22
  function select(selection) {
24
- return new SelectMultiple(
23
+ return new Select(
25
24
  new QueryData.Select({
26
25
  selection: ExprData.create(selection)
27
26
  })
@@ -29,7 +28,7 @@ function select(selection) {
29
28
  }
30
29
  function from(source) {
31
30
  const target = Query.isQuery(source) ? new Target.Query(source[Query.Data]) : new Target.Table(source[Table.Data]);
32
- return new SelectMultiple(
31
+ return new Select(
33
32
  new QueryData.Select({
34
33
  from: target,
35
34
  selection: new ExprData.Row(target)
@@ -1,4 +1,4 @@
1
- import { ExprData } from './Expr';
1
+ import { ExprData } from './Expr.js';
2
2
  export declare enum OrderDirection {
3
3
  Asc = "Asc",
4
4
  Desc = "Desc"
@@ -1,4 +1,3 @@
1
- // src/define/OrderBy.ts
2
1
  var OrderDirection = /* @__PURE__ */ ((OrderDirection2) => {
3
2
  OrderDirection2["Asc"] = "Asc";
4
3
  OrderDirection2["Desc"] = "Desc";
@@ -1,4 +1,3 @@
1
- // src/define/Param.ts
2
1
  var ParamType = /* @__PURE__ */ ((ParamType2) => {
3
2
  ParamType2["Value"] = "ParamData.Value";
4
3
  ParamType2["Named"] = "ParamData.Named";
@@ -1,12 +1,12 @@
1
- import { Driver } from '../lib/Driver';
2
- import { CompileOptions } from '../lib/Formatter';
3
- import { ColumnData } from './Column';
4
- import { EV, ExprData } from './Expr';
5
- import { IndexData } from './Index';
6
- import { OrderBy } from './OrderBy';
7
- import { Selection } from './Selection';
8
- import { TableData } from './Table';
9
- import { Target } from './Target';
1
+ import { Driver } from '../lib/Driver.js';
2
+ import { CompileOptions } from '../lib/Formatter.js';
3
+ import { ColumnData } from './Column.js';
4
+ import { EV, ExprData } from './Expr.js';
5
+ import { IndexData } from './Index.js';
6
+ import { OrderBy } from './OrderBy.js';
7
+ import { Selection } from './Selection.js';
8
+ import { TableData } from './Table.js';
9
+ import { Target } from './Target.js';
10
10
  export declare enum QueryType {
11
11
  Insert = "QueryData.Insert",
12
12
  Select = "QueryData.Select",
@@ -1,6 +1,5 @@
1
- // src/define/Query.ts
2
1
  import { Expr } from "./Expr.js";
3
- var { assign } = Object;
2
+ const { assign } = Object;
4
3
  var QueryType = /* @__PURE__ */ ((QueryType2) => {
5
4
  QueryType2["Insert"] = "QueryData.Insert";
6
5
  QueryType2["Select"] = "QueryData.Select";
@@ -98,7 +97,7 @@ var QueryData;
98
97
  }
99
98
  QueryData2.Raw = Raw;
100
99
  })(QueryData || (QueryData = {}));
101
- var Query = class {
100
+ class Query {
102
101
  constructor(query) {
103
102
  this[Query.Data] = query;
104
103
  }
@@ -127,7 +126,7 @@ var Query = class {
127
126
  conditions.push(new Expr(query.where));
128
127
  return query.with({ where: Expr.and(...conditions)[Expr.Data] });
129
128
  }
130
- };
129
+ }
131
130
  ((Query2) => {
132
131
  Query2.Data = Symbol("Query.Data");
133
132
  function isQuery(input) {
@@ -1,6 +1,6 @@
1
- import { Formatter } from '../lib/Formatter';
2
- import { QueryData } from './Query';
3
- import { Table, TableData } from './Table';
1
+ import { Formatter } from '../lib/Formatter.js';
2
+ import { QueryData } from './Query.js';
3
+ import { Table, TableData } from './Table.js';
4
4
  export interface SchemaInstructions {
5
5
  columns: Record<string, string>;
6
6
  indexes: Record<string, string>;
@@ -1,4 +1,3 @@
1
- // src/define/Schema.ts
2
1
  import { Statement } from "../lib/Statement.js";
3
2
  import { Expr, ExprData } from "./Expr.js";
4
3
  import { QueryData, QueryType } from "./Query.js";
@@ -1,6 +1,6 @@
1
- import type { Expr } from './Expr';
2
- import type { SelectMultiple, SelectSingle } from './query/Select';
3
- type SelectionBase = unknown | (() => any) | Expr<any> | SelectMultiple<any> | SelectSingle<any>;
1
+ import type { Expr } from './Expr.js';
2
+ import type { Select, SelectFirst } from './query/Select.js';
3
+ type SelectionBase = unknown | (() => any) | Expr<any> | Select<any> | SelectFirst<any>;
4
4
  interface SelectionRecord extends Record<string, Selection> {
5
5
  }
6
6
  export type Selection = SelectionBase | SelectionRecord;
@@ -1,4 +1,3 @@
1
- // src/define/Selection.ts
2
1
  var Selection;
3
2
  ((Selection2) => {
4
3
  })(Selection || (Selection = {}));
@@ -1,4 +1,4 @@
1
- import { Query } from './Query';
1
+ import { Query } from './Query.js';
2
2
  export declare function sql<T>(strings: TemplateStringsArray, ...params: Array<unknown>): Query<T>;
3
3
  export declare namespace sql {
4
4
  function all<T>(strings: TemplateStringsArray, ...params: Array<unknown>): Query<T>;
@@ -1,4 +1,3 @@
1
- // src/define/Sql.ts
2
1
  import { Query, QueryData } from "./Query.js";
3
2
  function sql(strings, ...params) {
4
3
  return new Query(new QueryData.Raw({ strings, params }));
@@ -1,11 +1,11 @@
1
- import { ClearFunctionProto } from '../util/Callable';
2
- import { Column, ColumnData, OptionalColumn, PrimaryColumn } from './Column';
3
- import { EV, Expr } from './Expr';
4
- import type { Fields } from './Fields';
5
- import { Index, IndexData } from './Index';
6
- import type { Selection } from './Selection';
7
- import { SelectSingle } from './query/Select';
8
- import { TableSelect } from './query/TableSelect';
1
+ import { ClearFunctionProto } from '../util/Callable.js';
2
+ import { Column, ColumnData, OptionalColumn, PrimaryColumn } from './Column.js';
3
+ import { EV, Expr } from './Expr.js';
4
+ import type { Fields } from './Fields.js';
5
+ import { Index, IndexData } from './Index.js';
6
+ import type { Selection } from './Selection.js';
7
+ import { SelectFirst } from './query/Select.js';
8
+ import { TableSelect } from './query/TableSelect.js';
9
9
  interface TableDefinition {
10
10
  }
11
11
  export declare class TableData {
@@ -36,7 +36,7 @@ type RowOf<Definition> = {
36
36
  [K in keyof Definition as Definition[K] extends Column<any> ? K : never]: Definition[K] extends Column<infer T> ? T : never;
37
37
  };
38
38
  type UpdateOf<Definition> = Partial<{
39
- [K in keyof Definition as Definition[K] extends Column<any> ? K : never]: Definition[K] extends Column<infer T> ? EV<T> | SelectSingle<T> : never;
39
+ [K in keyof Definition as Definition[K] extends Column<any> ? K : never]: Definition[K] extends Column<infer T> ? EV<T> | SelectFirst<T> : never;
40
40
  }>;
41
41
  export declare namespace Table {
42
42
  export const Data: unique symbol;
@@ -1,4 +1,3 @@
1
- // src/define/Table.ts
2
1
  import {
3
2
  Column,
4
3
  ColumnType
@@ -6,7 +5,7 @@ import {
6
5
  import { BinOpType, Expr, ExprData } from "./Expr.js";
7
6
  import { Target } from "./Target.js";
8
7
  import { TableSelect } from "./query/TableSelect.js";
9
- var {
8
+ const {
10
9
  assign,
11
10
  keys,
12
11
  entries,
@@ -16,11 +15,11 @@ var {
16
15
  setPrototypeOf,
17
16
  defineProperty
18
17
  } = Object;
19
- var TableData = class {
18
+ class TableData {
20
19
  constructor(data) {
21
20
  assign(this, data);
22
21
  }
23
- };
22
+ }
24
23
  var Table;
25
24
  ((Table2) => {
26
25
  Table2.Data = Symbol("Table.Data");
@@ -1,6 +1,6 @@
1
- import type { ExprData } from './Expr';
2
- import type { QueryData } from './Query';
3
- import type { TableData } from './Table';
1
+ import type { ExprData } from './Expr.js';
2
+ import type { QueryData } from './Query.js';
3
+ import type { TableData } from './Table.js';
4
4
  export declare enum TargetType {
5
5
  Expr = "Target.Expr",
6
6
  CTE = "Target.CTE",
@@ -1,4 +1,3 @@
1
- // src/define/Target.ts
2
1
  var TargetType = /* @__PURE__ */ ((TargetType2) => {
3
2
  TargetType2["Expr"] = "Target.Expr";
4
3
  TargetType2["CTE"] = "Target.CTE";
@@ -1,16 +1,16 @@
1
- import { ClearFunctionProto } from '../util/Callable';
2
- import { Column } from './Column';
3
- import { EV, Expr } from './Expr';
4
- import { Fields } from './Fields';
5
- import { Selection } from './Selection';
6
- import { Table } from './Table';
7
- import { Target } from './Target';
8
- import { SelectMultiple } from './query/Select';
1
+ import { ClearFunctionProto } from '../util/Callable.js';
2
+ import { Column } from './Column.js';
3
+ import { EV, Expr } from './Expr.js';
4
+ import { Fields } from './Fields.js';
5
+ import { Selection } from './Selection.js';
6
+ import { Table } from './Table.js';
7
+ import { Target } from './Target.js';
8
+ import { Select } from './query/Select.js';
9
9
  export interface VirtualTableInstance<Definition> extends ClearFunctionProto {
10
10
  (conditions: {
11
11
  [K in keyof Definition]?: Definition[K] extends Expr<infer V> ? EV<V> : never;
12
- }): SelectMultiple<Table.Select<Definition>>;
13
- (...conditions: Array<EV<boolean>>): SelectMultiple<Table.Select<Definition>>;
12
+ }): Select<Table.Select<Definition>>;
13
+ (...conditions: Array<EV<boolean>>): Select<Table.Select<Definition>>;
14
14
  }
15
15
  export declare class VirtualTableInstance<Definition> {
16
16
  [Selection.TableType](): Table.Select<Definition>;
@@ -19,7 +19,7 @@ export declare class VirtualTableInstance<Definition> {
19
19
  export interface VirtualTableData {
20
20
  name: string;
21
21
  target: Target;
22
- select: (conditions: Array<EV<boolean>>) => SelectMultiple<any>;
22
+ select: (conditions: Array<EV<boolean>>) => Select<any>;
23
23
  }
24
24
  export type VirtualTable<Definition> = Definition & VirtualTableInstance<Definition>;
25
25
  export declare namespace VirtualTable {
@@ -1,6 +1,5 @@
1
- // src/define/VirtualTable.ts
2
1
  import { BinOpType, Expr, ExprData } from "./Expr.js";
3
- var { create, entries } = Object;
2
+ const { create, entries } = Object;
4
3
  var VirtualTable;
5
4
  ((VirtualTable2) => {
6
5
  VirtualTable2.Data = Symbol("VirtualTable.Data");
@@ -1,4 +1,4 @@
1
- import { Query, QueryData } from '../Query';
1
+ import { Query, QueryData } from '../Query.js';
2
2
  export declare class Batch<T = void> extends Query<T> {
3
3
  protected queries: Array<QueryData>;
4
4
  [Query.Data]: QueryData.Batch;
@@ -1,6 +1,5 @@
1
- // src/define/query/Batch.ts
2
1
  import { Query, QueryData } from "../Query.js";
3
- var Batch = class extends Query {
2
+ class Batch extends Query {
4
3
  constructor(queries) {
5
4
  super(new QueryData.Batch({ queries }));
6
5
  this.queries = queries;
@@ -12,7 +11,7 @@ var Batch = class extends Query {
12
11
  })
13
12
  );
14
13
  }
15
- };
14
+ }
16
15
  export {
17
16
  Batch
18
17
  };
@@ -1,5 +1,5 @@
1
- import { Query } from '../Query';
2
- import { TableData } from '../Table';
1
+ import { Query } from '../Query.js';
2
+ import { TableData } from '../Table.js';
3
3
  export declare class CreateTable extends Query<void> {
4
4
  protected table: TableData;
5
5
  constructor(table: TableData);
@@ -1,12 +1,11 @@
1
- // src/define/query/CreateTable.ts
2
1
  import { Query } from "../Query.js";
3
2
  import { Schema } from "../Schema.js";
4
- var CreateTable = class extends Query {
3
+ class CreateTable extends Query {
5
4
  constructor(table) {
6
5
  super(Schema.create(table));
7
6
  this.table = table;
8
7
  }
9
- };
8
+ }
10
9
  export {
11
10
  CreateTable
12
11
  };
@@ -1,5 +1,5 @@
1
- import { EV } from '../Expr';
2
- import { Query, QueryData } from '../Query';
1
+ import { EV } from '../Expr.js';
2
+ import { Query, QueryData } from '../Query.js';
3
3
  export declare class Delete extends Query<{
4
4
  rowsAffected: number;
5
5
  }> {
@@ -1,6 +1,5 @@
1
- // src/define/query/Delete.ts
2
1
  import { Query } from "../Query.js";
3
- var Delete = class extends Query {
2
+ class Delete extends Query {
4
3
  constructor(query) {
5
4
  super(query);
6
5
  }
@@ -13,7 +12,7 @@ var Delete = class extends Query {
13
12
  skip(offset) {
14
13
  return new Delete(this[Query.Data].with({ offset }));
15
14
  }
16
- };
15
+ }
17
16
  export {
18
17
  Delete
19
18
  };
@@ -1,7 +1,7 @@
1
- import { Query, QueryData } from '../Query';
2
- import { Selection } from '../Selection';
3
- import { Table, TableData } from '../Table';
4
- import { SelectMultiple } from './Select';
1
+ import { Query, QueryData } from '../Query.js';
2
+ import { Selection } from '../Selection.js';
3
+ import { Table, TableData } from '../Table.js';
4
+ import { Select } from './Select.js';
5
5
  export declare class InsertValuesReturning<T> extends Query<T> {
6
6
  }
7
7
  export declare class Inserted extends Query<{
@@ -14,6 +14,6 @@ export declare class Inserted extends Query<{
14
14
  export declare class Insert<Definition> {
15
15
  protected into: TableData;
16
16
  constructor(into: TableData);
17
- selection(query: SelectMultiple<Table.Select<Definition>>): Inserted;
17
+ selection(query: Select<Table.Select<Definition>>): Inserted;
18
18
  values(...data: Array<Table.Insert<Definition>>): Inserted;
19
19
  }
@@ -1,9 +1,8 @@
1
- // src/define/query/Insert.ts
2
1
  import { ExprData } from "../Expr.js";
3
2
  import { Query, QueryData } from "../Query.js";
4
- var InsertValuesReturning = class extends Query {
5
- };
6
- var Inserted = class extends Query {
3
+ class InsertValuesReturning extends Query {
4
+ }
5
+ class Inserted extends Query {
7
6
  constructor(query) {
8
7
  super(query);
9
8
  }
@@ -15,8 +14,8 @@ var Inserted = class extends Query {
15
14
  })
16
15
  );
17
16
  }
18
- };
19
- var Insert = class {
17
+ }
18
+ class Insert {
20
19
  constructor(into) {
21
20
  this.into = into;
22
21
  }
@@ -28,7 +27,7 @@ var Insert = class {
28
27
  values(...data) {
29
28
  return new Inserted(new QueryData.Insert({ into: this.into, data }));
30
29
  }
31
- };
30
+ }
32
31
  export {
33
32
  Insert,
34
33
  InsertValuesReturning,