rado 0.3.1 → 0.3.3

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.
@@ -1,5 +1,14 @@
1
- import { Expr } from "./Expr.js";
2
- const { assign } = Object;
1
+ import { randomAlias } from "../util/Alias.js";
2
+ import { Expr, ExprData, ExprType } from "./Expr.js";
3
+ import { Functions } from "./Functions.js";
4
+ import { Schema } from "./Schema.js";
5
+ import { Table, createTable } from "./Table.js";
6
+ import { Target, TargetType } from "./Target.js";
7
+ import {
8
+ VirtualTable,
9
+ createVirtualTable
10
+ } from "./VirtualTable.js";
11
+ const { keys, assign, fromEntries } = Object;
3
12
  var QueryType = /* @__PURE__ */ ((QueryType2) => {
4
13
  QueryType2["Insert"] = "QueryData.Insert";
5
14
  QueryType2["Select"] = "QueryData.Select";
@@ -33,30 +42,30 @@ var QueryData;
33
42
  UnionOperation2["Intersect"] = "Intersect";
34
43
  UnionOperation2["Except"] = "Except";
35
44
  })(UnionOperation = QueryData2.UnionOperation || (QueryData2.UnionOperation = {}));
36
- class Union extends Data {
45
+ class Union2 extends Data {
37
46
  type = "QueryData.Union" /* Union */;
38
47
  }
39
- QueryData2.Union = Union;
40
- class Select extends Data {
48
+ QueryData2.Union = Union2;
49
+ class Select2 extends Data {
41
50
  type = "QueryData.Select" /* Select */;
42
51
  }
43
- QueryData2.Select = Select;
44
- class Insert extends Data {
52
+ QueryData2.Select = Select2;
53
+ class Insert2 extends Data {
45
54
  type = "QueryData.Insert" /* Insert */;
46
55
  }
47
- QueryData2.Insert = Insert;
48
- class Update extends Data {
56
+ QueryData2.Insert = Insert2;
57
+ class Update2 extends Data {
49
58
  type = "QueryData.Update" /* Update */;
50
59
  }
51
- QueryData2.Update = Update;
52
- class Delete extends Data {
60
+ QueryData2.Update = Update2;
61
+ class Delete2 extends Data {
53
62
  type = "QueryData.Delete" /* Delete */;
54
63
  }
55
- QueryData2.Delete = Delete;
56
- class CreateTable extends Data {
64
+ QueryData2.Delete = Delete2;
65
+ class CreateTable2 extends Data {
57
66
  type = "QueryData.CreateTable" /* CreateTable */;
58
67
  }
59
- QueryData2.CreateTable = CreateTable;
68
+ QueryData2.CreateTable = CreateTable2;
60
69
  class AlterTable extends Data {
61
70
  type = "QueryData.AlterTable" /* AlterTable */;
62
71
  }
@@ -73,10 +82,10 @@ var QueryData;
73
82
  type = "QueryData.DropIndex" /* DropIndex */;
74
83
  }
75
84
  QueryData2.DropIndex = DropIndex;
76
- class Batch extends Data {
85
+ class Batch2 extends Data {
77
86
  type = "QueryData.Batch" /* Batch */;
78
87
  }
79
- QueryData2.Batch = Batch;
88
+ QueryData2.Batch = Batch2;
80
89
  let TransactionOperation;
81
90
  ((TransactionOperation2) => {
82
91
  TransactionOperation2["Begin"] = "Begin";
@@ -134,8 +143,454 @@ class Query {
134
143
  }
135
144
  Query2.isQuery = isQuery;
136
145
  })(Query || (Query = {}));
146
+ class Batch extends Query {
147
+ constructor(queries) {
148
+ super(new QueryData.Batch({ queries }));
149
+ this.queries = queries;
150
+ }
151
+ next(cursor) {
152
+ return new Query(
153
+ new QueryData.Batch({
154
+ queries: [...this[Query.Data].queries, cursor[Query.Data]]
155
+ })
156
+ );
157
+ }
158
+ }
159
+ class CreateTable extends Query {
160
+ constructor(table) {
161
+ super(Schema.create(table));
162
+ this.table = table;
163
+ }
164
+ }
165
+ class Delete extends Query {
166
+ constructor(query) {
167
+ super(query);
168
+ }
169
+ where(...where) {
170
+ return new Delete(this.addWhere(where));
171
+ }
172
+ orderBy(...orderBy) {
173
+ return new Delete(this[Query.Data].with({ orderBy }));
174
+ }
175
+ take(limit) {
176
+ return new Delete(this[Query.Data].with({ limit }));
177
+ }
178
+ skip(offset) {
179
+ return new Delete(this[Query.Data].with({ offset }));
180
+ }
181
+ }
182
+ class Insert extends Query {
183
+ constructor(query) {
184
+ super(query);
185
+ }
186
+ returning(selection) {
187
+ return new Insert(
188
+ new QueryData.Insert({
189
+ ...this[Query.Data],
190
+ selection: ExprData.create(selection)
191
+ })
192
+ );
193
+ }
194
+ }
195
+ class InsertOne extends Query {
196
+ constructor(query) {
197
+ super(query);
198
+ }
199
+ returning(selection) {
200
+ return new Insert(
201
+ new QueryData.Insert({
202
+ ...this[Query.Data],
203
+ selection: ExprData.create(selection),
204
+ singleResult: true
205
+ })
206
+ );
207
+ }
208
+ }
209
+ class InsertInto {
210
+ constructor(into) {
211
+ this.into = into;
212
+ }
213
+ selection(query) {
214
+ return new Insert(
215
+ new QueryData.Insert({ into: this.into, select: query[Query.Data] })
216
+ );
217
+ }
218
+ values(...data) {
219
+ return new Insert(new QueryData.Insert({ into: this.into, data }));
220
+ }
221
+ }
222
+ function joinTarget(joinType, query, to, on) {
223
+ const toQuery = Query.isQuery(to) ? to[Query.Data] : void 0;
224
+ const target = toQuery ? toQuery.from : new Target.Table(to[Table.Data]);
225
+ if (!query.from || !target)
226
+ throw new Error("No from clause");
227
+ const conditions = [...on];
228
+ if (toQuery) {
229
+ const where = toQuery.where;
230
+ if (where)
231
+ conditions.push(new Expr(where));
232
+ }
233
+ return new Target.Join(
234
+ query.from,
235
+ target,
236
+ joinType,
237
+ Expr.and(...conditions)[Expr.Data]
238
+ );
239
+ }
240
+ function columnsOf(expr) {
241
+ switch (expr.type) {
242
+ case ExprType.Record:
243
+ return keys(expr.fields);
244
+ case ExprType.Row:
245
+ switch (expr.target.type) {
246
+ case TargetType.Table:
247
+ return keys(expr.target.table.columns);
248
+ default:
249
+ throw new Error("Could not retrieve CTE columns");
250
+ }
251
+ default:
252
+ throw new Error("Could not retrieve CTE columns");
253
+ }
254
+ }
255
+ function makeRecursiveUnion(initial, createUnion, operator) {
256
+ const name = randomAlias();
257
+ const cols = columnsOf(initial.selection);
258
+ const union = new QueryData.Union({
259
+ a: initial,
260
+ operator,
261
+ b: () => createUnion()[Query.Data]
262
+ });
263
+ const target = new Target.CTE(name, union);
264
+ const row = new ExprData.Row(target);
265
+ const selection = new ExprData.Record(
266
+ fromEntries(cols.map((col) => [col, new ExprData.Field(row, col)]))
267
+ );
268
+ const select = (conditions) => {
269
+ const where = Expr.and(...conditions)[Expr.Data];
270
+ return new Select(
271
+ new QueryData.Select({
272
+ selection,
273
+ from: target,
274
+ where
275
+ })
276
+ );
277
+ };
278
+ const cte = createVirtualTable({
279
+ name,
280
+ target,
281
+ select
282
+ });
283
+ return cte;
284
+ }
285
+ class RecursiveUnion {
286
+ constructor(initialSelect) {
287
+ this.initialSelect = initialSelect;
288
+ }
289
+ union(create) {
290
+ return makeRecursiveUnion(
291
+ this.initialSelect,
292
+ create,
293
+ "Union" /* Union */
294
+ );
295
+ }
296
+ unionAll(create) {
297
+ return makeRecursiveUnion(
298
+ this.initialSelect,
299
+ create,
300
+ "UnionAll" /* UnionAll */
301
+ );
302
+ }
303
+ }
304
+ class Union extends Query {
305
+ constructor(query) {
306
+ super(query);
307
+ }
308
+ union(query) {
309
+ return new Union(
310
+ new QueryData.Union({
311
+ a: this[Query.Data],
312
+ operator: "Union" /* Union */,
313
+ b: query[Query.Data]
314
+ })
315
+ );
316
+ }
317
+ unionAll(query) {
318
+ return new Union(
319
+ new QueryData.Union({
320
+ a: this[Query.Data],
321
+ operator: "UnionAll" /* UnionAll */,
322
+ b: query[Query.Data]
323
+ })
324
+ );
325
+ }
326
+ except(query) {
327
+ return new Union(
328
+ new QueryData.Union({
329
+ a: this[Query.Data],
330
+ operator: "Except" /* Except */,
331
+ b: query[Query.Data]
332
+ })
333
+ );
334
+ }
335
+ intersect(query) {
336
+ return new Union(
337
+ new QueryData.Union({
338
+ a: this[Query.Data],
339
+ operator: "Intersect" /* Intersect */,
340
+ b: query[Query.Data]
341
+ })
342
+ );
343
+ }
344
+ }
345
+ class Select extends Union {
346
+ constructor(query) {
347
+ super(query);
348
+ }
349
+ from(table) {
350
+ const virtual = table[VirtualTable.Data];
351
+ return new Select(
352
+ this[Query.Data].with({ from: virtual?.target || new Target.Table(table) })
353
+ );
354
+ }
355
+ indexedBy(index) {
356
+ const from = this[Query.Data].from;
357
+ switch (from?.type) {
358
+ case TargetType.Table:
359
+ return new Select(
360
+ this[Query.Data].with({
361
+ from: new Target.Table(from.table, index)
362
+ })
363
+ );
364
+ default:
365
+ throw new Error("Cannot index by without table target");
366
+ }
367
+ }
368
+ leftJoin(that, ...on) {
369
+ const query = this[Query.Data];
370
+ return new Select(
371
+ this[Query.Data].with({
372
+ from: joinTarget("left", query, that, on)
373
+ })
374
+ );
375
+ }
376
+ innerJoin(that, ...on) {
377
+ const query = this[Query.Data];
378
+ return new Select(
379
+ this[Query.Data].with({
380
+ from: joinTarget("inner", query, that, on)
381
+ })
382
+ );
383
+ }
384
+ select(selection) {
385
+ return new Select(
386
+ this[Query.Data].with({
387
+ selection: ExprData.create(selection)
388
+ })
389
+ );
390
+ }
391
+ count() {
392
+ return new SelectFirst(
393
+ this[Query.Data].with({
394
+ selection: Functions.count()[Expr.Data],
395
+ singleResult: true
396
+ })
397
+ );
398
+ }
399
+ orderBy(...orderBy) {
400
+ return new Select(
401
+ this[Query.Data].with({
402
+ orderBy: orderBy.map((e) => {
403
+ return Expr.isExpr(e) ? e.asc() : e;
404
+ })
405
+ })
406
+ );
407
+ }
408
+ groupBy(...groupBy) {
409
+ return new Select(
410
+ this[Query.Data].with({
411
+ groupBy: groupBy.map(ExprData.create)
412
+ })
413
+ );
414
+ }
415
+ maybeFirst() {
416
+ return new SelectFirst(this[Query.Data].with({ singleResult: true }));
417
+ }
418
+ first() {
419
+ return new SelectFirst(
420
+ this[Query.Data].with({
421
+ singleResult: true,
422
+ validate: true
423
+ })
424
+ );
425
+ }
426
+ where(...where) {
427
+ return new Select(this.addWhere(where));
428
+ }
429
+ take(limit) {
430
+ return new Select(this[Query.Data].with({ limit }));
431
+ }
432
+ skip(offset) {
433
+ return new Select(this[Query.Data].with({ offset }));
434
+ }
435
+ [Expr.ToExpr]() {
436
+ return new Expr(new ExprData.Query(this[Query.Data]));
437
+ }
438
+ }
439
+ class SelectFirst extends Query {
440
+ constructor(query) {
441
+ super(query);
442
+ }
443
+ from(table) {
444
+ return new Select(this[Query.Data].with({ from: new Target.Table(table) }));
445
+ }
446
+ leftJoin(that, ...on) {
447
+ const query = this[Query.Data];
448
+ return new SelectFirst(
449
+ this[Query.Data].with({
450
+ from: joinTarget("left", query, that, on)
451
+ })
452
+ );
453
+ }
454
+ innerJoin(that, ...on) {
455
+ const query = this[Query.Data];
456
+ return new SelectFirst(
457
+ this[Query.Data].with({
458
+ from: joinTarget("inner", query, that, on)
459
+ })
460
+ );
461
+ }
462
+ select(selection) {
463
+ return new SelectFirst(
464
+ this[Query.Data].with({
465
+ selection: ExprData.create(selection)
466
+ })
467
+ );
468
+ }
469
+ orderBy(...orderBy) {
470
+ return new SelectFirst(
471
+ this[Query.Data].with({
472
+ orderBy
473
+ })
474
+ );
475
+ }
476
+ groupBy(...groupBy) {
477
+ return new SelectFirst(
478
+ this[Query.Data].with({
479
+ groupBy: groupBy.map(ExprData.create)
480
+ })
481
+ );
482
+ }
483
+ where(...where) {
484
+ return new SelectFirst(this.addWhere(where));
485
+ }
486
+ take(limit) {
487
+ return new SelectFirst(this[Query.Data].with({ limit }));
488
+ }
489
+ skip(offset) {
490
+ return new SelectFirst(this[Query.Data].with({ offset }));
491
+ }
492
+ all() {
493
+ return new Select(this[Query.Data].with({ singleResult: false }));
494
+ }
495
+ [Expr.ToExpr]() {
496
+ return new Expr(new ExprData.Query(this[Query.Data]));
497
+ }
498
+ }
499
+ class TableSelect extends Select {
500
+ constructor(table, conditions = []) {
501
+ const target = new Target.Table(table);
502
+ super(
503
+ new QueryData.Select({
504
+ from: target,
505
+ selection: new ExprData.Row(target),
506
+ where: Expr.and(...conditions)[Expr.Data]
507
+ })
508
+ );
509
+ this.table = table;
510
+ }
511
+ as(alias) {
512
+ return createTable({ ...this.table, alias });
513
+ }
514
+ create() {
515
+ return new CreateTable(this.table);
516
+ }
517
+ insert(input) {
518
+ if (input instanceof Select) {
519
+ return this.insertSelect(input);
520
+ } else if (Array.isArray(input)) {
521
+ return this.insertAll(input);
522
+ } else {
523
+ return this.insertOne(input);
524
+ }
525
+ }
526
+ insertSelect(query) {
527
+ return new Insert(
528
+ new QueryData.Insert({ into: this.table, select: query[Query.Data] })
529
+ );
530
+ }
531
+ insertOne(record) {
532
+ return new InsertOne(
533
+ new QueryData.Insert({
534
+ into: this.table,
535
+ data: [record],
536
+ selection: new ExprData.Row(new Target.Table(this.table)),
537
+ singleResult: true
538
+ })
539
+ );
540
+ }
541
+ insertAll(data) {
542
+ return new InsertInto(this.table).values(...data);
543
+ }
544
+ set(data) {
545
+ return new Update(
546
+ new QueryData.Update({
547
+ table: this.table,
548
+ where: this[Query.Data].where
549
+ })
550
+ ).set(data);
551
+ }
552
+ delete() {
553
+ return new Delete(
554
+ new QueryData.Delete({
555
+ table: this.table,
556
+ where: this[Query.Data].where
557
+ })
558
+ );
559
+ }
560
+ get(name) {
561
+ return new Expr(
562
+ new ExprData.Field(new ExprData.Row(new Target.Table(this.table)), name)
563
+ );
564
+ }
565
+ }
566
+ class Update extends Query {
567
+ set(set) {
568
+ return new Update(this[Query.Data].with({ set }));
569
+ }
570
+ where(...where) {
571
+ return new Update(this.addWhere(where));
572
+ }
573
+ take(limit) {
574
+ return new Update(this[Query.Data].with({ limit }));
575
+ }
576
+ skip(offset) {
577
+ return new Update(this[Query.Data].with({ offset }));
578
+ }
579
+ }
137
580
  export {
581
+ Batch,
582
+ CreateTable,
583
+ Delete,
584
+ Insert,
585
+ InsertInto,
586
+ InsertOne,
138
587
  Query,
139
588
  QueryData,
140
- QueryType
589
+ QueryType,
590
+ RecursiveUnion,
591
+ Select,
592
+ SelectFirst,
593
+ TableSelect,
594
+ Union,
595
+ Update
141
596
  };
@@ -1,6 +1,6 @@
1
1
  import type { Column } from './Column.js';
2
2
  import type { Expr } from './Expr.js';
3
- import type { Select, SelectFirst } from './query/Select.js';
3
+ import type { Select, SelectFirst } from './Query.js';
4
4
  type SelectionBase = unknown | (() => any) | Expr<any> | Select<any> | SelectFirst<any>;
5
5
  interface SelectionRecord extends Record<string, Selection> {
6
6
  }
@@ -3,9 +3,8 @@ import { Column, ColumnData, OptionalColumn, PrimaryColumn } from './Column.js';
3
3
  import { EV, Expr } from './Expr.js';
4
4
  import type { Fields } from './Fields.js';
5
5
  import { Index, IndexData } from './Index.js';
6
+ import { SelectFirst, TableSelect } from './Query.js';
6
7
  import type { Selection } from './Selection.js';
7
- import { SelectFirst } from './query/Select.js';
8
- import { TableSelect } from './query/TableSelect.js';
9
8
  export declare class TableData {
10
9
  name: string;
11
10
  alias?: string;
@@ -3,8 +3,8 @@ import {
3
3
  ColumnType
4
4
  } from "./Column.js";
5
5
  import { BinOpType, Expr, ExprData } from "./Expr.js";
6
+ import { TableSelect } from "./Query.js";
6
7
  import { Target } from "./Target.js";
7
- import { TableSelect } from "./query/TableSelect.js";
8
8
  const {
9
9
  assign,
10
10
  keys,
@@ -2,10 +2,10 @@ import { Callable } from '../util/Callable.js';
2
2
  import { Column } from './Column.js';
3
3
  import { EV, Expr } from './Expr.js';
4
4
  import { Fields } from './Fields.js';
5
+ import { Select } from './Query.js';
5
6
  import { Selection } from './Selection.js';
6
7
  import { Table } from './Table.js';
7
8
  import { Target } from './Target.js';
8
- import { Select } from './query/Select.js';
9
9
  export interface VirtualTableInstance<Definition> extends Callable {
10
10
  (conditions: {
11
11
  [K in keyof Definition]?: Definition[K] extends Expr<infer V> ? EV<V> : never;
@@ -1,5 +1,4 @@
1
- import { QueryData } from "../define/Query.js";
2
- import { SelectFirst } from "../define/query/Select.js";
1
+ import { QueryData, SelectFirst } from "../define/Query.js";
3
2
  import { Driver } from "../lib/Driver.js";
4
3
  import { SqliteFormatter } from "../sqlite/SqliteFormatter.js";
5
4
  import { SqliteSchema } from "../sqlite/SqliteSchema.js";
package/dist/index.d.ts CHANGED
@@ -14,14 +14,6 @@ export * from './define/Sql.js';
14
14
  export * from './define/Table.js';
15
15
  export * from './define/Target.js';
16
16
  export * from './define/VirtualTable.js';
17
- export * from './define/query/Batch.js';
18
- export * from './define/query/CreateTable.js';
19
- export * from './define/query/Delete.js';
20
- export * from './define/query/Insert.js';
21
- export * from './define/query/Select.js';
22
- export * from './define/query/TableSelect.js';
23
- export * from './define/query/Union.js';
24
- export * from './define/query/Update.js';
25
17
  export type { Driver, DriverOptions } from './lib/Driver.js';
26
18
  export type { FormatContext, Formatter } from './lib/Formatter.js';
27
19
  export type { Sanitizer } from './lib/Sanitizer.js';
package/dist/index.js CHANGED
@@ -11,12 +11,4 @@ export * from "./define/Sql.js";
11
11
  export * from "./define/Table.js";
12
12
  export * from "./define/Target.js";
13
13
  export * from "./define/VirtualTable.js";
14
- export * from "./define/query/Batch.js";
15
- export * from "./define/query/CreateTable.js";
16
- export * from "./define/query/Delete.js";
17
- export * from "./define/query/Insert.js";
18
- export * from "./define/query/Select.js";
19
- export * from "./define/query/TableSelect.js";
20
- export * from "./define/query/Union.js";
21
- export * from "./define/query/Update.js";
22
14
  export * from "./lib/SqlError.js";
@@ -1,8 +1,7 @@
1
1
  import { Expr } from '../define/Expr.js';
2
- import { Query, QueryData } from '../define/Query.js';
2
+ import { Query, QueryData, Select } from '../define/Query.js';
3
3
  import { SchemaInstructions } from '../define/Schema.js';
4
4
  import { Table } from '../define/Table.js';
5
- import { Select } from '../define/query/Select.js';
6
5
  import { Callable } from '../util/Callable.js';
7
6
  import { Formatter } from './Formatter.js';
8
7
  import { Statement } from './Statement.js';
@@ -62,7 +62,7 @@ export declare abstract class Formatter implements Sanitizer {
62
62
  formatBatch(ctx: FormatContext, { queries }: QueryData.Batch): Statement;
63
63
  formatRaw(ctx: FormatContext, { strings, params }: QueryData.Raw): Statement;
64
64
  formatColumn(ctx: FormatContext, column: ColumnData): Statement;
65
- formatConstraintReference(ctx: FormatContext, reference: ExprData): Statement;
65
+ formatConstraintReference(ctx: FormatContext, { references, onDelete, onUpdate }: ColumnData): Statement;
66
66
  formatType(ctx: FormatContext, type: ColumnType): Statement;
67
67
  formatInsertRow(ctx: FormatContext, columns: Record<string, ColumnData>, row: Record<string, any>): Statement;
68
68
  formatColumnValue(ctx: FormatContext, column: ColumnData, columnValue: any): Statement;
@@ -1,4 +1,4 @@
1
- import { ColumnType } from "../define/Column.js";
1
+ import { Action, ColumnType } from "../define/Column.js";
2
2
  import { BinOpType, Expr, ExprData, ExprType, UnOpType } from "../define/Expr.js";
3
3
  import { OrderDirection } from "../define/OrderBy.js";
4
4
  import { ParamType } from "../define/Param.js";
@@ -36,6 +36,13 @@ const unions = {
36
36
  [QueryData.UnionOperation.Intersect]: "INTERSECT",
37
37
  [QueryData.UnionOperation.Except]: "EXCEPT"
38
38
  };
39
+ const actions = {
40
+ [Action.NoAction]: "NO ACTION",
41
+ [Action.Restrict]: "RESTRICT",
42
+ [Action.Cascade]: "CASCADE",
43
+ [Action.SetNull]: "SET NULL",
44
+ [Action.SetDefault]: "SET DEFAULT"
45
+ };
39
46
  function formatAsResultObject(stmt, mkSubject) {
40
47
  stmt.raw("json_object('result', ");
41
48
  mkSubject();
@@ -318,15 +325,23 @@ class Formatter {
318
325
  }
319
326
  }
320
327
  if (column.references)
321
- this.formatConstraintReference(ctx, column.references());
328
+ this.formatConstraintReference(ctx, column);
322
329
  return stmt;
323
330
  }
324
- formatConstraintReference(ctx, reference) {
331
+ formatConstraintReference(ctx, { references, onDelete, onUpdate }) {
325
332
  const { stmt } = ctx;
333
+ if (!references)
334
+ return stmt;
335
+ const reference = references();
326
336
  if (reference.type !== ExprType.Field || reference.expr.type !== ExprType.Row)
327
337
  throw new Error("not supported");
328
338
  const from = reference.expr.target;
329
- return stmt.add("REFERENCES").addIdentifier(Target.source(from).name).openParenthesis().identifier(reference.field).closeParenthesis();
339
+ stmt.add("REFERENCES").addIdentifier(Target.source(from).name).openParenthesis().identifier(reference.field).closeParenthesis();
340
+ if (onDelete && actions[onDelete])
341
+ stmt.add("ON DELETE").add(actions[onDelete]);
342
+ if (onUpdate && actions[onUpdate])
343
+ stmt.add("ON UPDATE").add(actions[onUpdate]);
344
+ return stmt;
330
345
  }
331
346
  formatType(ctx, type) {
332
347
  const { stmt } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rado",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,7 +0,0 @@
1
- import { Query, QueryData } from '../Query.js';
2
- export declare class Batch<T = void> extends Query<T> {
3
- protected queries: Array<QueryData>;
4
- [Query.Data]: QueryData.Batch;
5
- constructor(queries: Array<QueryData>);
6
- next<T>(cursor: Query<T>): Query<T>;
7
- }