docs-i18n 0.10.0 → 0.11.1

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 (67) hide show
  1. package/admin/app/lib/auth-client.ts +21 -0
  2. package/admin/app/lib/auth.server.ts +62 -0
  3. package/admin/app/routeTree.gen.ts +21 -3
  4. package/admin/app/routes/index.tsx +68 -8
  5. package/admin/app/routes/login.tsx +207 -0
  6. package/admin/app/server.ts +23 -0
  7. package/admin/app/styles.css +146 -0
  8. package/admin/app/worker.ts +61 -0
  9. package/admin/dist/client/assets/auth-client-DqJZaFZR.js +3 -0
  10. package/admin/dist/client/assets/login-CQjkiBAF.js +1 -0
  11. package/admin/dist/client/assets/main-bc5tcdGg.js +18 -0
  12. package/admin/dist/client/assets/routes-CTPOG_v1.js +3 -0
  13. package/admin/dist/client/assets/{styles-DJ6QEJmN.css → styles-zS0BbO7e.css} +1 -1
  14. package/admin/dist/client/assets/useNavigate-CEOVvMjz.js +1 -0
  15. package/admin/dist/server/assets/{react-dom-CpO9xk_L.js → __tanstack-start-server-fn-resolver-N1N5mZVv.js} +83 -507
  16. package/admin/dist/server/assets/_tanstack-start-manifest_v-BgMVPPt2.js +21 -0
  17. package/admin/dist/server/assets/adapter-DjXlUL1J.js +2253 -0
  18. package/admin/dist/server/assets/auth-client-CoUpyQIM.js +807 -0
  19. package/admin/dist/server/assets/auth-dSAIPjBw.js +72 -0
  20. package/admin/dist/server/assets/auth.server-BLVDnTCZ.js +31352 -0
  21. package/admin/dist/server/assets/bun-sqlite-dialect-C8OaCWSL-BNNY-FoT.js +154 -0
  22. package/admin/dist/server/assets/compiled-query-CnFG_BVV.js +6967 -0
  23. package/admin/dist/server/assets/d1-sqlite-dialect-sYHNqBte-Bjz-cybU.js +115 -0
  24. package/admin/dist/server/assets/dist-C3-e8E2B.js +215 -0
  25. package/admin/dist/server/assets/dist-CUzFWZag.js +6039 -0
  26. package/admin/dist/server/assets/{init-DJr2glb3.js → dist-DBv71kqn.js} +21 -381
  27. package/admin/dist/server/assets/error-CASJ5tIm.js +457 -0
  28. package/admin/dist/server/assets/error-codes-BhMTGvV6.js +1153 -0
  29. package/admin/dist/server/assets/init-CJJUsPDL.js +49 -0
  30. package/admin/dist/server/assets/job-manager-D9Ab9hgu.js +179 -0
  31. package/admin/dist/server/assets/{jobs-bQfYqSk7.js → jobs-DrEe9YOj.js} +18 -5
  32. package/admin/dist/server/assets/kysely-adapter-YC8RFPyc.js +2 -0
  33. package/admin/dist/server/assets/login-SqzTMYOZ.js +228 -0
  34. package/admin/dist/server/assets/migrator-ZpVZslbq.js +2926 -0
  35. package/admin/dist/server/assets/{misc-DOk3t9vs.js → misc-BSoYldBT.js} +22 -9
  36. package/admin/dist/server/assets/{models-CBb8Owe5.js → models-CoviNHUP.js} +1 -1
  37. package/admin/dist/server/assets/node-sqlite-dialect-BJIaP6lL.js +154 -0
  38. package/admin/dist/server/assets/{router-DlU_fGDK.js → router-Cxm33tn3.js} +23 -11
  39. package/admin/dist/server/assets/{routes-pIM0fgUO.js → routes-CxGhew8Z.js} +56 -22
  40. package/admin/dist/server/assets/{routes-BcfX6iub.js → routes-DtWFPDUc.js} +43 -29
  41. package/admin/dist/server/assets/sqlite-adapter-CL2EidjD.js +69 -0
  42. package/admin/dist/server/assets/{start-BS52hm79.js → start-BiybVoR2.js} +1 -1
  43. package/admin/dist/server/assets/status-B1AGLvHn.js +162 -0
  44. package/admin/dist/server/assets/status-D7PU72hm.js +262 -0
  45. package/admin/dist/server/assets/string-B4XlckmJ.js +6 -0
  46. package/admin/dist/server/assets/useNavigate-0H08s_Q2.js +29 -0
  47. package/admin/dist/server/assets/useRouter-BXJvr8to.js +508 -0
  48. package/admin/dist/server/server.js +70 -90
  49. package/admin/package.json +6 -1
  50. package/admin/server/functions/auth.ts +89 -0
  51. package/admin/server/functions/jobs.ts +30 -2
  52. package/admin/server/functions/misc.ts +25 -5
  53. package/admin/server/functions/status.ts +52 -3
  54. package/admin/server/index.ts +1 -1
  55. package/admin/server/init.ts +21 -9
  56. package/admin/server/services/d1-status.ts +282 -0
  57. package/admin/vite.config.ts +29 -15
  58. package/admin/wrangler.jsonc +16 -0
  59. package/package.json +1 -1
  60. package/template/content/docs-i18n/en/cli.md +9 -5
  61. package/template/content/docs-i18n/en/deployment.md +85 -68
  62. package/admin/dist/client/assets/main-CSFhgz4p.js +0 -17
  63. package/admin/dist/client/assets/routes-C6bCOSX-.js +0 -3
  64. package/admin/dist/server/assets/_tanstack-start-manifest_v-BE5XHVZ2.js +0 -17
  65. package/admin/dist/server/assets/redirect-DtfSYi2g.js +0 -51
  66. package/admin/dist/server/assets/status-CZz8Rs_7.js +0 -81
  67. /package/admin/dist/server/assets/{createServerRpc-DJq9yo-B.js → createServerRpc-Cyyxq9HQ.js} +0 -0
@@ -0,0 +1,2926 @@
1
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/util/object-utils.js
2
+ function isUndefined(obj) {
3
+ return typeof obj === "undefined" || obj === void 0;
4
+ }
5
+ function isString(obj) {
6
+ return typeof obj === "string";
7
+ }
8
+ function isNumber(obj) {
9
+ return typeof obj === "number";
10
+ }
11
+ function isBoolean(obj) {
12
+ return typeof obj === "boolean";
13
+ }
14
+ function isNull(obj) {
15
+ return obj === null;
16
+ }
17
+ function isDate(obj) {
18
+ return obj instanceof Date;
19
+ }
20
+ function isBigInt(obj) {
21
+ return typeof obj === "bigint";
22
+ }
23
+ function isBuffer(obj) {
24
+ return typeof Buffer !== "undefined" && Buffer.isBuffer(obj);
25
+ }
26
+ function isFunction(obj) {
27
+ return typeof obj === "function";
28
+ }
29
+ function isObject(obj) {
30
+ return typeof obj === "object" && obj !== null;
31
+ }
32
+ function freeze(obj) {
33
+ return Object.freeze(obj);
34
+ }
35
+ function asArray(arg) {
36
+ if (isReadonlyArray(arg)) return arg;
37
+ else return [arg];
38
+ }
39
+ function isReadonlyArray(arg) {
40
+ return Array.isArray(arg);
41
+ }
42
+ function noop(obj) {
43
+ return obj;
44
+ }
45
+ //#endregion
46
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/identifier-node.js
47
+ /**
48
+ * @internal
49
+ */
50
+ var IdentifierNode = freeze({
51
+ is(node) {
52
+ return node.kind === "IdentifierNode";
53
+ },
54
+ create(name) {
55
+ return freeze({
56
+ kind: "IdentifierNode",
57
+ name
58
+ });
59
+ }
60
+ });
61
+ //#endregion
62
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/create-table-node.js
63
+ var ON_COMMIT_ACTIONS = [
64
+ "preserve rows",
65
+ "delete rows",
66
+ "drop"
67
+ ];
68
+ /**
69
+ * @internal
70
+ */
71
+ var CreateTableNode = freeze({
72
+ is(node) {
73
+ return node.kind === "CreateTableNode";
74
+ },
75
+ create(table) {
76
+ return freeze({
77
+ kind: "CreateTableNode",
78
+ table,
79
+ columns: freeze([])
80
+ });
81
+ },
82
+ cloneWithColumn(createTable, column) {
83
+ return freeze({
84
+ ...createTable,
85
+ columns: freeze([...createTable.columns, column])
86
+ });
87
+ },
88
+ cloneWithConstraint(createTable, constraint) {
89
+ return freeze({
90
+ ...createTable,
91
+ constraints: createTable.constraints ? freeze([...createTable.constraints, constraint]) : freeze([constraint])
92
+ });
93
+ },
94
+ cloneWithFrontModifier(createTable, modifier) {
95
+ return freeze({
96
+ ...createTable,
97
+ frontModifiers: createTable.frontModifiers ? freeze([...createTable.frontModifiers, modifier]) : freeze([modifier])
98
+ });
99
+ },
100
+ cloneWithEndModifier(createTable, modifier) {
101
+ return freeze({
102
+ ...createTable,
103
+ endModifiers: createTable.endModifiers ? freeze([...createTable.endModifiers, modifier]) : freeze([modifier])
104
+ });
105
+ },
106
+ cloneWith(createTable, params) {
107
+ return freeze({
108
+ ...createTable,
109
+ ...params
110
+ });
111
+ }
112
+ });
113
+ //#endregion
114
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/schemable-identifier-node.js
115
+ /**
116
+ * @internal
117
+ */
118
+ var SchemableIdentifierNode = freeze({
119
+ is(node) {
120
+ return node.kind === "SchemableIdentifierNode";
121
+ },
122
+ create(identifier) {
123
+ return freeze({
124
+ kind: "SchemableIdentifierNode",
125
+ identifier: IdentifierNode.create(identifier)
126
+ });
127
+ },
128
+ createWithSchema(schema, identifier) {
129
+ return freeze({
130
+ kind: "SchemableIdentifierNode",
131
+ schema: IdentifierNode.create(schema),
132
+ identifier: IdentifierNode.create(identifier)
133
+ });
134
+ }
135
+ });
136
+ //#endregion
137
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/alias-node.js
138
+ /**
139
+ * @internal
140
+ */
141
+ var AliasNode = freeze({
142
+ is(node) {
143
+ return node.kind === "AliasNode";
144
+ },
145
+ create(node, alias) {
146
+ return freeze({
147
+ kind: "AliasNode",
148
+ node,
149
+ alias
150
+ });
151
+ }
152
+ });
153
+ //#endregion
154
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/table-node.js
155
+ /**
156
+ * @internal
157
+ */
158
+ var TableNode = freeze({
159
+ is(node) {
160
+ return node.kind === "TableNode";
161
+ },
162
+ create(table) {
163
+ return freeze({
164
+ kind: "TableNode",
165
+ table: SchemableIdentifierNode.create(table)
166
+ });
167
+ },
168
+ createWithSchema(schema, table) {
169
+ return freeze({
170
+ kind: "TableNode",
171
+ table: SchemableIdentifierNode.createWithSchema(schema, table)
172
+ });
173
+ }
174
+ });
175
+ //#endregion
176
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/and-node.js
177
+ /**
178
+ * @internal
179
+ */
180
+ var AndNode = freeze({
181
+ is(node) {
182
+ return node.kind === "AndNode";
183
+ },
184
+ create(left, right) {
185
+ return freeze({
186
+ kind: "AndNode",
187
+ left,
188
+ right
189
+ });
190
+ }
191
+ });
192
+ //#endregion
193
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/or-node.js
194
+ /**
195
+ * @internal
196
+ */
197
+ var OrNode = freeze({
198
+ is(node) {
199
+ return node.kind === "OrNode";
200
+ },
201
+ create(left, right) {
202
+ return freeze({
203
+ kind: "OrNode",
204
+ left,
205
+ right
206
+ });
207
+ }
208
+ });
209
+ //#endregion
210
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/on-node.js
211
+ /**
212
+ * @internal
213
+ */
214
+ var OnNode = freeze({
215
+ is(node) {
216
+ return node.kind === "OnNode";
217
+ },
218
+ create(filter) {
219
+ return freeze({
220
+ kind: "OnNode",
221
+ on: filter
222
+ });
223
+ },
224
+ cloneWithOperation(onNode, operator, operation) {
225
+ return freeze({
226
+ ...onNode,
227
+ on: operator === "And" ? AndNode.create(onNode.on, operation) : OrNode.create(onNode.on, operation)
228
+ });
229
+ }
230
+ });
231
+ //#endregion
232
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/join-node.js
233
+ /**
234
+ * @internal
235
+ */
236
+ var JoinNode = freeze({
237
+ is(node) {
238
+ return node.kind === "JoinNode";
239
+ },
240
+ create(joinType, table) {
241
+ return freeze({
242
+ kind: "JoinNode",
243
+ joinType,
244
+ table,
245
+ on: void 0
246
+ });
247
+ },
248
+ createWithOn(joinType, table, on) {
249
+ return freeze({
250
+ kind: "JoinNode",
251
+ joinType,
252
+ table,
253
+ on: OnNode.create(on)
254
+ });
255
+ },
256
+ cloneWithOn(joinNode, operation) {
257
+ return freeze({
258
+ ...joinNode,
259
+ on: joinNode.on ? OnNode.cloneWithOperation(joinNode.on, "And", operation) : OnNode.create(operation)
260
+ });
261
+ }
262
+ });
263
+ //#endregion
264
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/operator-node.js
265
+ var COMPARISON_OPERATORS = [
266
+ "=",
267
+ "==",
268
+ "!=",
269
+ "<>",
270
+ ">",
271
+ ">=",
272
+ "<",
273
+ "<=",
274
+ "in",
275
+ "not in",
276
+ "is",
277
+ "is not",
278
+ "like",
279
+ "not like",
280
+ "match",
281
+ "ilike",
282
+ "not ilike",
283
+ "@>",
284
+ "<@",
285
+ "^@",
286
+ "&&",
287
+ "?",
288
+ "?&",
289
+ "?|",
290
+ "!<",
291
+ "!>",
292
+ "<=>",
293
+ "!~",
294
+ "~",
295
+ "~*",
296
+ "!~*",
297
+ "@@",
298
+ "@@@",
299
+ "!!",
300
+ "<->",
301
+ "regexp",
302
+ "is distinct from",
303
+ "is not distinct from"
304
+ ];
305
+ var ARITHMETIC_OPERATORS = [
306
+ "+",
307
+ "-",
308
+ "*",
309
+ "/",
310
+ "%",
311
+ "^",
312
+ "&",
313
+ "|",
314
+ "#",
315
+ "<<",
316
+ ">>"
317
+ ];
318
+ var JSON_OPERATORS = ["->", "->>"];
319
+ var BINARY_OPERATORS = [
320
+ ...COMPARISON_OPERATORS,
321
+ ...ARITHMETIC_OPERATORS,
322
+ "&&",
323
+ "||"
324
+ ];
325
+ var UNARY_OPERATORS = [
326
+ "not",
327
+ "-",
328
+ ...["exists", "not exists"]
329
+ ];
330
+ var OPERATORS = [
331
+ ...BINARY_OPERATORS,
332
+ ...JSON_OPERATORS,
333
+ ...UNARY_OPERATORS,
334
+ "between",
335
+ "between symmetric"
336
+ ];
337
+ /**
338
+ * @internal
339
+ */
340
+ var OperatorNode = freeze({
341
+ is(node) {
342
+ return node.kind === "OperatorNode";
343
+ },
344
+ create(operator) {
345
+ return freeze({
346
+ kind: "OperatorNode",
347
+ operator
348
+ });
349
+ }
350
+ });
351
+ function isJSONOperator(op) {
352
+ return isString(op) && JSON_OPERATORS.includes(op);
353
+ }
354
+ //#endregion
355
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/raw-node.js
356
+ /**
357
+ * @internal
358
+ */
359
+ var RawNode = freeze({
360
+ is(node) {
361
+ return node.kind === "RawNode";
362
+ },
363
+ create(sqlFragments, parameters) {
364
+ return freeze({
365
+ kind: "RawNode",
366
+ sqlFragments: freeze(sqlFragments),
367
+ parameters: freeze(parameters)
368
+ });
369
+ },
370
+ createWithSql(sql) {
371
+ return RawNode.create([sql], []);
372
+ },
373
+ createWithChild(child) {
374
+ return RawNode.create(["", ""], [child]);
375
+ },
376
+ createWithChildren(children) {
377
+ return RawNode.create(new Array(children.length + 1).fill(""), children);
378
+ }
379
+ });
380
+ //#endregion
381
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/util/log-once.js
382
+ var LOGGED_MESSAGES = /* @__PURE__ */ new Set();
383
+ /**
384
+ * Use for system-level logging, such as deprecation messages.
385
+ * Logs a message and ensures it won't be logged again.
386
+ */
387
+ function logOnce(message) {
388
+ if (LOGGED_MESSAGES.has(message)) return;
389
+ LOGGED_MESSAGES.add(message);
390
+ console.log(message);
391
+ }
392
+ //#endregion
393
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/parens-node.js
394
+ /**
395
+ * @internal
396
+ */
397
+ var ParensNode = freeze({
398
+ is(node) {
399
+ return node.kind === "ParensNode";
400
+ },
401
+ create(node) {
402
+ return freeze({
403
+ kind: "ParensNode",
404
+ node
405
+ });
406
+ }
407
+ });
408
+ //#endregion
409
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/insert-query-node.js
410
+ /**
411
+ * @internal
412
+ */
413
+ var InsertQueryNode = freeze({
414
+ is(node) {
415
+ return node.kind === "InsertQueryNode";
416
+ },
417
+ create(into, withNode, replace) {
418
+ return freeze({
419
+ kind: "InsertQueryNode",
420
+ into,
421
+ ...withNode && { with: withNode },
422
+ replace
423
+ });
424
+ },
425
+ createWithoutInto() {
426
+ return freeze({ kind: "InsertQueryNode" });
427
+ },
428
+ cloneWith(insertQuery, props) {
429
+ return freeze({
430
+ ...insertQuery,
431
+ ...props
432
+ });
433
+ }
434
+ });
435
+ //#endregion
436
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/list-node.js
437
+ /**
438
+ * @internal
439
+ */
440
+ var ListNode = freeze({
441
+ is(node) {
442
+ return node.kind === "ListNode";
443
+ },
444
+ create(items) {
445
+ return freeze({
446
+ kind: "ListNode",
447
+ items: freeze(items)
448
+ });
449
+ }
450
+ });
451
+ //#endregion
452
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/using-node.js
453
+ /**
454
+ * @internal
455
+ */
456
+ var UsingNode = freeze({
457
+ is(node) {
458
+ return node.kind === "UsingNode";
459
+ },
460
+ create(tables) {
461
+ return freeze({
462
+ kind: "UsingNode",
463
+ tables: freeze(tables)
464
+ });
465
+ },
466
+ cloneWithTables(using, tables) {
467
+ return freeze({
468
+ ...using,
469
+ tables: freeze([...using.tables, ...tables])
470
+ });
471
+ }
472
+ });
473
+ //#endregion
474
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/when-node.js
475
+ /**
476
+ * @internal
477
+ */
478
+ var WhenNode = freeze({
479
+ is(node) {
480
+ return node.kind === "WhenNode";
481
+ },
482
+ create(condition) {
483
+ return freeze({
484
+ kind: "WhenNode",
485
+ condition
486
+ });
487
+ },
488
+ cloneWithResult(whenNode, result) {
489
+ return freeze({
490
+ ...whenNode,
491
+ result
492
+ });
493
+ }
494
+ });
495
+ //#endregion
496
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/util/require-all-props.js
497
+ /**
498
+ * Helper function to check listed properties according to given type. Check if all properties has been used when object is initialised.
499
+ *
500
+ * Example use:
501
+ *
502
+ * ```ts
503
+ * type SomeType = { propA: string; propB?: number; }
504
+ *
505
+ * // propB has to be mentioned even it is optional. It still should be initialized with undefined.
506
+ * const a: SomeType = requireAllProps<SomeType>({ propA: "value A", propB: undefined });
507
+ *
508
+ * // checked type is implicit for variable.
509
+ * const b = requireAllProps<SomeType>({ propA: "value A", propB: undefined });
510
+ * ```
511
+ *
512
+ * Wrong use of this helper:
513
+ *
514
+ * 1. Omit checked type - all checked properties will be expect as of type never
515
+ *
516
+ * ```ts
517
+ * type SomeType = { propA: string; propB?: number; }
518
+ * // const z: SomeType = requireAllProps({ propC: "no type will work" }); // Property 'propA' is missing in type '{ propC: string; }' but required in type 'SomeType'.
519
+ * ```
520
+ *
521
+ * 2. Apply to spreaded object - there is no way how to check in compile time if spreaded object contains all properties
522
+ *
523
+ * ```ts
524
+ * type SomeType = { propA: string; propB?: number; }
525
+ * const y: SomeType = { propA: "" }; // valid object according to SomeType declaration
526
+ * // const x = requireAllProps<SomeType>({ ...y }); // Argument of type '{ propA: string; propB?: number; }' is not assignable to parameter of type 'AllProps<SomeType>'.
527
+ * ```
528
+ *
529
+ * @param obj object to check if all properties has been used
530
+ * @returns untouched obj parameter is returned
531
+ */
532
+ function requireAllProps(obj) {
533
+ return obj;
534
+ }
535
+ //#endregion
536
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/operation-node-transformer.js
537
+ /**
538
+ * Transforms an operation node tree into another one.
539
+ *
540
+ * Kysely queries are expressed internally as a tree of objects (operation nodes).
541
+ * `OperationNodeTransformer` takes such a tree as its input and returns a
542
+ * transformed deep copy of it. By default the `OperationNodeTransformer`
543
+ * does nothing. You need to override one or more methods to make it do
544
+ * something.
545
+ *
546
+ * There's a method for each node type. For example if you'd like to convert
547
+ * each identifier (table name, column name, alias etc.) from camelCase to
548
+ * snake_case, you'd do something like this:
549
+ *
550
+ * ```ts
551
+ * import { type IdentifierNode, OperationNodeTransformer } from 'kysely'
552
+ * import snakeCase from 'lodash/snakeCase'
553
+ *
554
+ * class CamelCaseTransformer extends OperationNodeTransformer {
555
+ * override transformIdentifier(node: IdentifierNode): IdentifierNode {
556
+ * node = super.transformIdentifier(node)
557
+ *
558
+ * return {
559
+ * ...node,
560
+ * name: snakeCase(node.name),
561
+ * }
562
+ * }
563
+ * }
564
+ *
565
+ * const transformer = new CamelCaseTransformer()
566
+ *
567
+ * const query = db.selectFrom('person').select(['first_name', 'last_name'])
568
+ *
569
+ * const tree = transformer.transformNode(query.toOperationNode())
570
+ * ```
571
+ */
572
+ var OperationNodeTransformer = class {
573
+ nodeStack = [];
574
+ #transformers = freeze({
575
+ AliasNode: this.transformAlias.bind(this),
576
+ ColumnNode: this.transformColumn.bind(this),
577
+ IdentifierNode: this.transformIdentifier.bind(this),
578
+ SchemableIdentifierNode: this.transformSchemableIdentifier.bind(this),
579
+ RawNode: this.transformRaw.bind(this),
580
+ ReferenceNode: this.transformReference.bind(this),
581
+ SelectQueryNode: this.transformSelectQuery.bind(this),
582
+ SelectionNode: this.transformSelection.bind(this),
583
+ TableNode: this.transformTable.bind(this),
584
+ FromNode: this.transformFrom.bind(this),
585
+ SelectAllNode: this.transformSelectAll.bind(this),
586
+ AndNode: this.transformAnd.bind(this),
587
+ OrNode: this.transformOr.bind(this),
588
+ ValueNode: this.transformValue.bind(this),
589
+ ValueListNode: this.transformValueList.bind(this),
590
+ PrimitiveValueListNode: this.transformPrimitiveValueList.bind(this),
591
+ ParensNode: this.transformParens.bind(this),
592
+ JoinNode: this.transformJoin.bind(this),
593
+ OperatorNode: this.transformOperator.bind(this),
594
+ WhereNode: this.transformWhere.bind(this),
595
+ InsertQueryNode: this.transformInsertQuery.bind(this),
596
+ DeleteQueryNode: this.transformDeleteQuery.bind(this),
597
+ ReturningNode: this.transformReturning.bind(this),
598
+ CreateTableNode: this.transformCreateTable.bind(this),
599
+ AddColumnNode: this.transformAddColumn.bind(this),
600
+ ColumnDefinitionNode: this.transformColumnDefinition.bind(this),
601
+ DropTableNode: this.transformDropTable.bind(this),
602
+ DataTypeNode: this.transformDataType.bind(this),
603
+ OrderByNode: this.transformOrderBy.bind(this),
604
+ OrderByItemNode: this.transformOrderByItem.bind(this),
605
+ GroupByNode: this.transformGroupBy.bind(this),
606
+ GroupByItemNode: this.transformGroupByItem.bind(this),
607
+ UpdateQueryNode: this.transformUpdateQuery.bind(this),
608
+ ColumnUpdateNode: this.transformColumnUpdate.bind(this),
609
+ LimitNode: this.transformLimit.bind(this),
610
+ OffsetNode: this.transformOffset.bind(this),
611
+ OnConflictNode: this.transformOnConflict.bind(this),
612
+ OnDuplicateKeyNode: this.transformOnDuplicateKey.bind(this),
613
+ CreateIndexNode: this.transformCreateIndex.bind(this),
614
+ DropIndexNode: this.transformDropIndex.bind(this),
615
+ ListNode: this.transformList.bind(this),
616
+ PrimaryKeyConstraintNode: this.transformPrimaryKeyConstraint.bind(this),
617
+ UniqueConstraintNode: this.transformUniqueConstraint.bind(this),
618
+ ReferencesNode: this.transformReferences.bind(this),
619
+ CheckConstraintNode: this.transformCheckConstraint.bind(this),
620
+ WithNode: this.transformWith.bind(this),
621
+ CommonTableExpressionNode: this.transformCommonTableExpression.bind(this),
622
+ CommonTableExpressionNameNode: this.transformCommonTableExpressionName.bind(this),
623
+ HavingNode: this.transformHaving.bind(this),
624
+ CreateSchemaNode: this.transformCreateSchema.bind(this),
625
+ DropSchemaNode: this.transformDropSchema.bind(this),
626
+ AlterTableNode: this.transformAlterTable.bind(this),
627
+ DropColumnNode: this.transformDropColumn.bind(this),
628
+ RenameColumnNode: this.transformRenameColumn.bind(this),
629
+ AlterColumnNode: this.transformAlterColumn.bind(this),
630
+ ModifyColumnNode: this.transformModifyColumn.bind(this),
631
+ AddConstraintNode: this.transformAddConstraint.bind(this),
632
+ DropConstraintNode: this.transformDropConstraint.bind(this),
633
+ RenameConstraintNode: this.transformRenameConstraint.bind(this),
634
+ ForeignKeyConstraintNode: this.transformForeignKeyConstraint.bind(this),
635
+ CreateViewNode: this.transformCreateView.bind(this),
636
+ RefreshMaterializedViewNode: this.transformRefreshMaterializedView.bind(this),
637
+ DropViewNode: this.transformDropView.bind(this),
638
+ GeneratedNode: this.transformGenerated.bind(this),
639
+ DefaultValueNode: this.transformDefaultValue.bind(this),
640
+ OnNode: this.transformOn.bind(this),
641
+ ValuesNode: this.transformValues.bind(this),
642
+ SelectModifierNode: this.transformSelectModifier.bind(this),
643
+ CreateTypeNode: this.transformCreateType.bind(this),
644
+ DropTypeNode: this.transformDropType.bind(this),
645
+ ExplainNode: this.transformExplain.bind(this),
646
+ DefaultInsertValueNode: this.transformDefaultInsertValue.bind(this),
647
+ AggregateFunctionNode: this.transformAggregateFunction.bind(this),
648
+ OverNode: this.transformOver.bind(this),
649
+ PartitionByNode: this.transformPartitionBy.bind(this),
650
+ PartitionByItemNode: this.transformPartitionByItem.bind(this),
651
+ SetOperationNode: this.transformSetOperation.bind(this),
652
+ BinaryOperationNode: this.transformBinaryOperation.bind(this),
653
+ UnaryOperationNode: this.transformUnaryOperation.bind(this),
654
+ UsingNode: this.transformUsing.bind(this),
655
+ FunctionNode: this.transformFunction.bind(this),
656
+ CaseNode: this.transformCase.bind(this),
657
+ WhenNode: this.transformWhen.bind(this),
658
+ JSONReferenceNode: this.transformJSONReference.bind(this),
659
+ JSONPathNode: this.transformJSONPath.bind(this),
660
+ JSONPathLegNode: this.transformJSONPathLeg.bind(this),
661
+ JSONOperatorChainNode: this.transformJSONOperatorChain.bind(this),
662
+ TupleNode: this.transformTuple.bind(this),
663
+ MergeQueryNode: this.transformMergeQuery.bind(this),
664
+ MatchedNode: this.transformMatched.bind(this),
665
+ AddIndexNode: this.transformAddIndex.bind(this),
666
+ CastNode: this.transformCast.bind(this),
667
+ FetchNode: this.transformFetch.bind(this),
668
+ TopNode: this.transformTop.bind(this),
669
+ OutputNode: this.transformOutput.bind(this),
670
+ OrActionNode: this.transformOrAction.bind(this),
671
+ CollateNode: this.transformCollate.bind(this)
672
+ });
673
+ transformNode(node, queryId) {
674
+ if (!node) return node;
675
+ this.nodeStack.push(node);
676
+ const out = this.transformNodeImpl(node, queryId);
677
+ this.nodeStack.pop();
678
+ return freeze(out);
679
+ }
680
+ transformNodeImpl(node, queryId) {
681
+ return this.#transformers[node.kind](node, queryId);
682
+ }
683
+ transformNodeList(list, queryId) {
684
+ if (!list) return list;
685
+ return freeze(list.map((node) => this.transformNode(node, queryId)));
686
+ }
687
+ transformSelectQuery(node, queryId) {
688
+ return requireAllProps({
689
+ kind: "SelectQueryNode",
690
+ from: this.transformNode(node.from, queryId),
691
+ selections: this.transformNodeList(node.selections, queryId),
692
+ distinctOn: this.transformNodeList(node.distinctOn, queryId),
693
+ joins: this.transformNodeList(node.joins, queryId),
694
+ groupBy: this.transformNode(node.groupBy, queryId),
695
+ orderBy: this.transformNode(node.orderBy, queryId),
696
+ where: this.transformNode(node.where, queryId),
697
+ frontModifiers: this.transformNodeList(node.frontModifiers, queryId),
698
+ endModifiers: this.transformNodeList(node.endModifiers, queryId),
699
+ limit: this.transformNode(node.limit, queryId),
700
+ offset: this.transformNode(node.offset, queryId),
701
+ with: this.transformNode(node.with, queryId),
702
+ having: this.transformNode(node.having, queryId),
703
+ explain: this.transformNode(node.explain, queryId),
704
+ setOperations: this.transformNodeList(node.setOperations, queryId),
705
+ fetch: this.transformNode(node.fetch, queryId),
706
+ top: this.transformNode(node.top, queryId)
707
+ });
708
+ }
709
+ transformSelection(node, queryId) {
710
+ return requireAllProps({
711
+ kind: "SelectionNode",
712
+ selection: this.transformNode(node.selection, queryId)
713
+ });
714
+ }
715
+ transformColumn(node, queryId) {
716
+ return requireAllProps({
717
+ kind: "ColumnNode",
718
+ column: this.transformNode(node.column, queryId)
719
+ });
720
+ }
721
+ transformAlias(node, queryId) {
722
+ return requireAllProps({
723
+ kind: "AliasNode",
724
+ node: this.transformNode(node.node, queryId),
725
+ alias: this.transformNode(node.alias, queryId)
726
+ });
727
+ }
728
+ transformTable(node, queryId) {
729
+ return requireAllProps({
730
+ kind: "TableNode",
731
+ table: this.transformNode(node.table, queryId)
732
+ });
733
+ }
734
+ transformFrom(node, queryId) {
735
+ return requireAllProps({
736
+ kind: "FromNode",
737
+ froms: this.transformNodeList(node.froms, queryId)
738
+ });
739
+ }
740
+ transformReference(node, queryId) {
741
+ return requireAllProps({
742
+ kind: "ReferenceNode",
743
+ column: this.transformNode(node.column, queryId),
744
+ table: this.transformNode(node.table, queryId)
745
+ });
746
+ }
747
+ transformAnd(node, queryId) {
748
+ return requireAllProps({
749
+ kind: "AndNode",
750
+ left: this.transformNode(node.left, queryId),
751
+ right: this.transformNode(node.right, queryId)
752
+ });
753
+ }
754
+ transformOr(node, queryId) {
755
+ return requireAllProps({
756
+ kind: "OrNode",
757
+ left: this.transformNode(node.left, queryId),
758
+ right: this.transformNode(node.right, queryId)
759
+ });
760
+ }
761
+ transformValueList(node, queryId) {
762
+ return requireAllProps({
763
+ kind: "ValueListNode",
764
+ values: this.transformNodeList(node.values, queryId)
765
+ });
766
+ }
767
+ transformParens(node, queryId) {
768
+ return requireAllProps({
769
+ kind: "ParensNode",
770
+ node: this.transformNode(node.node, queryId)
771
+ });
772
+ }
773
+ transformJoin(node, queryId) {
774
+ return requireAllProps({
775
+ kind: "JoinNode",
776
+ joinType: node.joinType,
777
+ table: this.transformNode(node.table, queryId),
778
+ on: this.transformNode(node.on, queryId)
779
+ });
780
+ }
781
+ transformRaw(node, queryId) {
782
+ return requireAllProps({
783
+ kind: "RawNode",
784
+ sqlFragments: freeze([...node.sqlFragments]),
785
+ parameters: this.transformNodeList(node.parameters, queryId)
786
+ });
787
+ }
788
+ transformWhere(node, queryId) {
789
+ return requireAllProps({
790
+ kind: "WhereNode",
791
+ where: this.transformNode(node.where, queryId)
792
+ });
793
+ }
794
+ transformInsertQuery(node, queryId) {
795
+ return requireAllProps({
796
+ kind: "InsertQueryNode",
797
+ into: this.transformNode(node.into, queryId),
798
+ columns: this.transformNodeList(node.columns, queryId),
799
+ values: this.transformNode(node.values, queryId),
800
+ returning: this.transformNode(node.returning, queryId),
801
+ onConflict: this.transformNode(node.onConflict, queryId),
802
+ onDuplicateKey: this.transformNode(node.onDuplicateKey, queryId),
803
+ endModifiers: this.transformNodeList(node.endModifiers, queryId),
804
+ with: this.transformNode(node.with, queryId),
805
+ ignore: node.ignore,
806
+ orAction: this.transformNode(node.orAction, queryId),
807
+ replace: node.replace,
808
+ explain: this.transformNode(node.explain, queryId),
809
+ defaultValues: node.defaultValues,
810
+ top: this.transformNode(node.top, queryId),
811
+ output: this.transformNode(node.output, queryId)
812
+ });
813
+ }
814
+ transformValues(node, queryId) {
815
+ return requireAllProps({
816
+ kind: "ValuesNode",
817
+ values: this.transformNodeList(node.values, queryId)
818
+ });
819
+ }
820
+ transformDeleteQuery(node, queryId) {
821
+ return requireAllProps({
822
+ kind: "DeleteQueryNode",
823
+ from: this.transformNode(node.from, queryId),
824
+ using: this.transformNode(node.using, queryId),
825
+ joins: this.transformNodeList(node.joins, queryId),
826
+ where: this.transformNode(node.where, queryId),
827
+ returning: this.transformNode(node.returning, queryId),
828
+ endModifiers: this.transformNodeList(node.endModifiers, queryId),
829
+ with: this.transformNode(node.with, queryId),
830
+ orderBy: this.transformNode(node.orderBy, queryId),
831
+ limit: this.transformNode(node.limit, queryId),
832
+ explain: this.transformNode(node.explain, queryId),
833
+ top: this.transformNode(node.top, queryId),
834
+ output: this.transformNode(node.output, queryId)
835
+ });
836
+ }
837
+ transformReturning(node, queryId) {
838
+ return requireAllProps({
839
+ kind: "ReturningNode",
840
+ selections: this.transformNodeList(node.selections, queryId)
841
+ });
842
+ }
843
+ transformCreateTable(node, queryId) {
844
+ return requireAllProps({
845
+ kind: "CreateTableNode",
846
+ table: this.transformNode(node.table, queryId),
847
+ columns: this.transformNodeList(node.columns, queryId),
848
+ constraints: this.transformNodeList(node.constraints, queryId),
849
+ temporary: node.temporary,
850
+ ifNotExists: node.ifNotExists,
851
+ onCommit: node.onCommit,
852
+ frontModifiers: this.transformNodeList(node.frontModifiers, queryId),
853
+ endModifiers: this.transformNodeList(node.endModifiers, queryId),
854
+ selectQuery: this.transformNode(node.selectQuery, queryId)
855
+ });
856
+ }
857
+ transformColumnDefinition(node, queryId) {
858
+ return requireAllProps({
859
+ kind: "ColumnDefinitionNode",
860
+ column: this.transformNode(node.column, queryId),
861
+ dataType: this.transformNode(node.dataType, queryId),
862
+ references: this.transformNode(node.references, queryId),
863
+ primaryKey: node.primaryKey,
864
+ autoIncrement: node.autoIncrement,
865
+ unique: node.unique,
866
+ notNull: node.notNull,
867
+ unsigned: node.unsigned,
868
+ defaultTo: this.transformNode(node.defaultTo, queryId),
869
+ check: this.transformNode(node.check, queryId),
870
+ generated: this.transformNode(node.generated, queryId),
871
+ frontModifiers: this.transformNodeList(node.frontModifiers, queryId),
872
+ endModifiers: this.transformNodeList(node.endModifiers, queryId),
873
+ nullsNotDistinct: node.nullsNotDistinct,
874
+ identity: node.identity,
875
+ ifNotExists: node.ifNotExists
876
+ });
877
+ }
878
+ transformAddColumn(node, queryId) {
879
+ return requireAllProps({
880
+ kind: "AddColumnNode",
881
+ column: this.transformNode(node.column, queryId)
882
+ });
883
+ }
884
+ transformDropTable(node, queryId) {
885
+ return requireAllProps({
886
+ kind: "DropTableNode",
887
+ table: this.transformNode(node.table, queryId),
888
+ ifExists: node.ifExists,
889
+ cascade: node.cascade
890
+ });
891
+ }
892
+ transformOrderBy(node, queryId) {
893
+ return requireAllProps({
894
+ kind: "OrderByNode",
895
+ items: this.transformNodeList(node.items, queryId)
896
+ });
897
+ }
898
+ transformOrderByItem(node, queryId) {
899
+ return requireAllProps({
900
+ kind: "OrderByItemNode",
901
+ orderBy: this.transformNode(node.orderBy, queryId),
902
+ direction: this.transformNode(node.direction, queryId),
903
+ collation: this.transformNode(node.collation, queryId),
904
+ nulls: node.nulls
905
+ });
906
+ }
907
+ transformGroupBy(node, queryId) {
908
+ return requireAllProps({
909
+ kind: "GroupByNode",
910
+ items: this.transformNodeList(node.items, queryId)
911
+ });
912
+ }
913
+ transformGroupByItem(node, queryId) {
914
+ return requireAllProps({
915
+ kind: "GroupByItemNode",
916
+ groupBy: this.transformNode(node.groupBy, queryId)
917
+ });
918
+ }
919
+ transformUpdateQuery(node, queryId) {
920
+ return requireAllProps({
921
+ kind: "UpdateQueryNode",
922
+ table: this.transformNode(node.table, queryId),
923
+ from: this.transformNode(node.from, queryId),
924
+ joins: this.transformNodeList(node.joins, queryId),
925
+ where: this.transformNode(node.where, queryId),
926
+ updates: this.transformNodeList(node.updates, queryId),
927
+ returning: this.transformNode(node.returning, queryId),
928
+ endModifiers: this.transformNodeList(node.endModifiers, queryId),
929
+ with: this.transformNode(node.with, queryId),
930
+ explain: this.transformNode(node.explain, queryId),
931
+ limit: this.transformNode(node.limit, queryId),
932
+ top: this.transformNode(node.top, queryId),
933
+ output: this.transformNode(node.output, queryId),
934
+ orderBy: this.transformNode(node.orderBy, queryId)
935
+ });
936
+ }
937
+ transformColumnUpdate(node, queryId) {
938
+ return requireAllProps({
939
+ kind: "ColumnUpdateNode",
940
+ column: this.transformNode(node.column, queryId),
941
+ value: this.transformNode(node.value, queryId)
942
+ });
943
+ }
944
+ transformLimit(node, queryId) {
945
+ return requireAllProps({
946
+ kind: "LimitNode",
947
+ limit: this.transformNode(node.limit, queryId)
948
+ });
949
+ }
950
+ transformOffset(node, queryId) {
951
+ return requireAllProps({
952
+ kind: "OffsetNode",
953
+ offset: this.transformNode(node.offset, queryId)
954
+ });
955
+ }
956
+ transformOnConflict(node, queryId) {
957
+ return requireAllProps({
958
+ kind: "OnConflictNode",
959
+ columns: this.transformNodeList(node.columns, queryId),
960
+ constraint: this.transformNode(node.constraint, queryId),
961
+ indexExpression: this.transformNode(node.indexExpression, queryId),
962
+ indexWhere: this.transformNode(node.indexWhere, queryId),
963
+ updates: this.transformNodeList(node.updates, queryId),
964
+ updateWhere: this.transformNode(node.updateWhere, queryId),
965
+ doNothing: node.doNothing
966
+ });
967
+ }
968
+ transformOnDuplicateKey(node, queryId) {
969
+ return requireAllProps({
970
+ kind: "OnDuplicateKeyNode",
971
+ updates: this.transformNodeList(node.updates, queryId)
972
+ });
973
+ }
974
+ transformCreateIndex(node, queryId) {
975
+ return requireAllProps({
976
+ kind: "CreateIndexNode",
977
+ name: this.transformNode(node.name, queryId),
978
+ table: this.transformNode(node.table, queryId),
979
+ columns: this.transformNodeList(node.columns, queryId),
980
+ unique: node.unique,
981
+ using: this.transformNode(node.using, queryId),
982
+ ifNotExists: node.ifNotExists,
983
+ where: this.transformNode(node.where, queryId),
984
+ nullsNotDistinct: node.nullsNotDistinct
985
+ });
986
+ }
987
+ transformList(node, queryId) {
988
+ return requireAllProps({
989
+ kind: "ListNode",
990
+ items: this.transformNodeList(node.items, queryId)
991
+ });
992
+ }
993
+ transformDropIndex(node, queryId) {
994
+ return requireAllProps({
995
+ kind: "DropIndexNode",
996
+ name: this.transformNode(node.name, queryId),
997
+ table: this.transformNode(node.table, queryId),
998
+ ifExists: node.ifExists,
999
+ cascade: node.cascade
1000
+ });
1001
+ }
1002
+ transformPrimaryKeyConstraint(node, queryId) {
1003
+ return requireAllProps({
1004
+ kind: "PrimaryKeyConstraintNode",
1005
+ columns: this.transformNodeList(node.columns, queryId),
1006
+ name: this.transformNode(node.name, queryId),
1007
+ deferrable: node.deferrable,
1008
+ initiallyDeferred: node.initiallyDeferred
1009
+ });
1010
+ }
1011
+ transformUniqueConstraint(node, queryId) {
1012
+ return requireAllProps({
1013
+ kind: "UniqueConstraintNode",
1014
+ columns: this.transformNodeList(node.columns, queryId),
1015
+ name: this.transformNode(node.name, queryId),
1016
+ nullsNotDistinct: node.nullsNotDistinct,
1017
+ deferrable: node.deferrable,
1018
+ initiallyDeferred: node.initiallyDeferred
1019
+ });
1020
+ }
1021
+ transformForeignKeyConstraint(node, queryId) {
1022
+ return requireAllProps({
1023
+ kind: "ForeignKeyConstraintNode",
1024
+ columns: this.transformNodeList(node.columns, queryId),
1025
+ references: this.transformNode(node.references, queryId),
1026
+ name: this.transformNode(node.name, queryId),
1027
+ onDelete: node.onDelete,
1028
+ onUpdate: node.onUpdate,
1029
+ deferrable: node.deferrable,
1030
+ initiallyDeferred: node.initiallyDeferred
1031
+ });
1032
+ }
1033
+ transformSetOperation(node, queryId) {
1034
+ return requireAllProps({
1035
+ kind: "SetOperationNode",
1036
+ operator: node.operator,
1037
+ expression: this.transformNode(node.expression, queryId),
1038
+ all: node.all
1039
+ });
1040
+ }
1041
+ transformReferences(node, queryId) {
1042
+ return requireAllProps({
1043
+ kind: "ReferencesNode",
1044
+ table: this.transformNode(node.table, queryId),
1045
+ columns: this.transformNodeList(node.columns, queryId),
1046
+ onDelete: node.onDelete,
1047
+ onUpdate: node.onUpdate
1048
+ });
1049
+ }
1050
+ transformCheckConstraint(node, queryId) {
1051
+ return requireAllProps({
1052
+ kind: "CheckConstraintNode",
1053
+ expression: this.transformNode(node.expression, queryId),
1054
+ name: this.transformNode(node.name, queryId)
1055
+ });
1056
+ }
1057
+ transformWith(node, queryId) {
1058
+ return requireAllProps({
1059
+ kind: "WithNode",
1060
+ expressions: this.transformNodeList(node.expressions, queryId),
1061
+ recursive: node.recursive
1062
+ });
1063
+ }
1064
+ transformCommonTableExpression(node, queryId) {
1065
+ return requireAllProps({
1066
+ kind: "CommonTableExpressionNode",
1067
+ name: this.transformNode(node.name, queryId),
1068
+ materialized: node.materialized,
1069
+ expression: this.transformNode(node.expression, queryId)
1070
+ });
1071
+ }
1072
+ transformCommonTableExpressionName(node, queryId) {
1073
+ return requireAllProps({
1074
+ kind: "CommonTableExpressionNameNode",
1075
+ table: this.transformNode(node.table, queryId),
1076
+ columns: this.transformNodeList(node.columns, queryId)
1077
+ });
1078
+ }
1079
+ transformHaving(node, queryId) {
1080
+ return requireAllProps({
1081
+ kind: "HavingNode",
1082
+ having: this.transformNode(node.having, queryId)
1083
+ });
1084
+ }
1085
+ transformCreateSchema(node, queryId) {
1086
+ return requireAllProps({
1087
+ kind: "CreateSchemaNode",
1088
+ schema: this.transformNode(node.schema, queryId),
1089
+ ifNotExists: node.ifNotExists
1090
+ });
1091
+ }
1092
+ transformDropSchema(node, queryId) {
1093
+ return requireAllProps({
1094
+ kind: "DropSchemaNode",
1095
+ schema: this.transformNode(node.schema, queryId),
1096
+ ifExists: node.ifExists,
1097
+ cascade: node.cascade
1098
+ });
1099
+ }
1100
+ transformAlterTable(node, queryId) {
1101
+ return requireAllProps({
1102
+ kind: "AlterTableNode",
1103
+ table: this.transformNode(node.table, queryId),
1104
+ renameTo: this.transformNode(node.renameTo, queryId),
1105
+ setSchema: this.transformNode(node.setSchema, queryId),
1106
+ columnAlterations: this.transformNodeList(node.columnAlterations, queryId),
1107
+ addConstraint: this.transformNode(node.addConstraint, queryId),
1108
+ dropConstraint: this.transformNode(node.dropConstraint, queryId),
1109
+ renameConstraint: this.transformNode(node.renameConstraint, queryId),
1110
+ addIndex: this.transformNode(node.addIndex, queryId),
1111
+ dropIndex: this.transformNode(node.dropIndex, queryId)
1112
+ });
1113
+ }
1114
+ transformDropColumn(node, queryId) {
1115
+ return requireAllProps({
1116
+ kind: "DropColumnNode",
1117
+ column: this.transformNode(node.column, queryId)
1118
+ });
1119
+ }
1120
+ transformRenameColumn(node, queryId) {
1121
+ return requireAllProps({
1122
+ kind: "RenameColumnNode",
1123
+ column: this.transformNode(node.column, queryId),
1124
+ renameTo: this.transformNode(node.renameTo, queryId)
1125
+ });
1126
+ }
1127
+ transformAlterColumn(node, queryId) {
1128
+ return requireAllProps({
1129
+ kind: "AlterColumnNode",
1130
+ column: this.transformNode(node.column, queryId),
1131
+ dataType: this.transformNode(node.dataType, queryId),
1132
+ dataTypeExpression: this.transformNode(node.dataTypeExpression, queryId),
1133
+ setDefault: this.transformNode(node.setDefault, queryId),
1134
+ dropDefault: node.dropDefault,
1135
+ setNotNull: node.setNotNull,
1136
+ dropNotNull: node.dropNotNull
1137
+ });
1138
+ }
1139
+ transformModifyColumn(node, queryId) {
1140
+ return requireAllProps({
1141
+ kind: "ModifyColumnNode",
1142
+ column: this.transformNode(node.column, queryId)
1143
+ });
1144
+ }
1145
+ transformAddConstraint(node, queryId) {
1146
+ return requireAllProps({
1147
+ kind: "AddConstraintNode",
1148
+ constraint: this.transformNode(node.constraint, queryId)
1149
+ });
1150
+ }
1151
+ transformDropConstraint(node, queryId) {
1152
+ return requireAllProps({
1153
+ kind: "DropConstraintNode",
1154
+ constraintName: this.transformNode(node.constraintName, queryId),
1155
+ ifExists: node.ifExists,
1156
+ modifier: node.modifier
1157
+ });
1158
+ }
1159
+ transformRenameConstraint(node, queryId) {
1160
+ return requireAllProps({
1161
+ kind: "RenameConstraintNode",
1162
+ oldName: this.transformNode(node.oldName, queryId),
1163
+ newName: this.transformNode(node.newName, queryId)
1164
+ });
1165
+ }
1166
+ transformCreateView(node, queryId) {
1167
+ return requireAllProps({
1168
+ kind: "CreateViewNode",
1169
+ name: this.transformNode(node.name, queryId),
1170
+ temporary: node.temporary,
1171
+ orReplace: node.orReplace,
1172
+ ifNotExists: node.ifNotExists,
1173
+ materialized: node.materialized,
1174
+ columns: this.transformNodeList(node.columns, queryId),
1175
+ as: this.transformNode(node.as, queryId)
1176
+ });
1177
+ }
1178
+ transformRefreshMaterializedView(node, queryId) {
1179
+ return requireAllProps({
1180
+ kind: "RefreshMaterializedViewNode",
1181
+ name: this.transformNode(node.name, queryId),
1182
+ concurrently: node.concurrently,
1183
+ withNoData: node.withNoData
1184
+ });
1185
+ }
1186
+ transformDropView(node, queryId) {
1187
+ return requireAllProps({
1188
+ kind: "DropViewNode",
1189
+ name: this.transformNode(node.name, queryId),
1190
+ ifExists: node.ifExists,
1191
+ materialized: node.materialized,
1192
+ cascade: node.cascade
1193
+ });
1194
+ }
1195
+ transformGenerated(node, queryId) {
1196
+ return requireAllProps({
1197
+ kind: "GeneratedNode",
1198
+ byDefault: node.byDefault,
1199
+ always: node.always,
1200
+ identity: node.identity,
1201
+ stored: node.stored,
1202
+ expression: this.transformNode(node.expression, queryId)
1203
+ });
1204
+ }
1205
+ transformDefaultValue(node, queryId) {
1206
+ return requireAllProps({
1207
+ kind: "DefaultValueNode",
1208
+ defaultValue: this.transformNode(node.defaultValue, queryId)
1209
+ });
1210
+ }
1211
+ transformOn(node, queryId) {
1212
+ return requireAllProps({
1213
+ kind: "OnNode",
1214
+ on: this.transformNode(node.on, queryId)
1215
+ });
1216
+ }
1217
+ transformSelectModifier(node, queryId) {
1218
+ return requireAllProps({
1219
+ kind: "SelectModifierNode",
1220
+ modifier: node.modifier,
1221
+ rawModifier: this.transformNode(node.rawModifier, queryId),
1222
+ of: this.transformNodeList(node.of, queryId)
1223
+ });
1224
+ }
1225
+ transformCreateType(node, queryId) {
1226
+ return requireAllProps({
1227
+ kind: "CreateTypeNode",
1228
+ name: this.transformNode(node.name, queryId),
1229
+ enum: this.transformNode(node.enum, queryId)
1230
+ });
1231
+ }
1232
+ transformDropType(node, queryId) {
1233
+ return requireAllProps({
1234
+ kind: "DropTypeNode",
1235
+ name: this.transformNode(node.name, queryId),
1236
+ ifExists: node.ifExists
1237
+ });
1238
+ }
1239
+ transformExplain(node, queryId) {
1240
+ return requireAllProps({
1241
+ kind: "ExplainNode",
1242
+ format: node.format,
1243
+ options: this.transformNode(node.options, queryId)
1244
+ });
1245
+ }
1246
+ transformSchemableIdentifier(node, queryId) {
1247
+ return requireAllProps({
1248
+ kind: "SchemableIdentifierNode",
1249
+ schema: this.transformNode(node.schema, queryId),
1250
+ identifier: this.transformNode(node.identifier, queryId)
1251
+ });
1252
+ }
1253
+ transformAggregateFunction(node, queryId) {
1254
+ return requireAllProps({
1255
+ kind: "AggregateFunctionNode",
1256
+ func: node.func,
1257
+ aggregated: this.transformNodeList(node.aggregated, queryId),
1258
+ distinct: node.distinct,
1259
+ orderBy: this.transformNode(node.orderBy, queryId),
1260
+ withinGroup: this.transformNode(node.withinGroup, queryId),
1261
+ filter: this.transformNode(node.filter, queryId),
1262
+ over: this.transformNode(node.over, queryId)
1263
+ });
1264
+ }
1265
+ transformOver(node, queryId) {
1266
+ return requireAllProps({
1267
+ kind: "OverNode",
1268
+ orderBy: this.transformNode(node.orderBy, queryId),
1269
+ partitionBy: this.transformNode(node.partitionBy, queryId)
1270
+ });
1271
+ }
1272
+ transformPartitionBy(node, queryId) {
1273
+ return requireAllProps({
1274
+ kind: "PartitionByNode",
1275
+ items: this.transformNodeList(node.items, queryId)
1276
+ });
1277
+ }
1278
+ transformPartitionByItem(node, queryId) {
1279
+ return requireAllProps({
1280
+ kind: "PartitionByItemNode",
1281
+ partitionBy: this.transformNode(node.partitionBy, queryId)
1282
+ });
1283
+ }
1284
+ transformBinaryOperation(node, queryId) {
1285
+ return requireAllProps({
1286
+ kind: "BinaryOperationNode",
1287
+ leftOperand: this.transformNode(node.leftOperand, queryId),
1288
+ operator: this.transformNode(node.operator, queryId),
1289
+ rightOperand: this.transformNode(node.rightOperand, queryId)
1290
+ });
1291
+ }
1292
+ transformUnaryOperation(node, queryId) {
1293
+ return requireAllProps({
1294
+ kind: "UnaryOperationNode",
1295
+ operator: this.transformNode(node.operator, queryId),
1296
+ operand: this.transformNode(node.operand, queryId)
1297
+ });
1298
+ }
1299
+ transformUsing(node, queryId) {
1300
+ return requireAllProps({
1301
+ kind: "UsingNode",
1302
+ tables: this.transformNodeList(node.tables, queryId)
1303
+ });
1304
+ }
1305
+ transformFunction(node, queryId) {
1306
+ return requireAllProps({
1307
+ kind: "FunctionNode",
1308
+ func: node.func,
1309
+ arguments: this.transformNodeList(node.arguments, queryId)
1310
+ });
1311
+ }
1312
+ transformCase(node, queryId) {
1313
+ return requireAllProps({
1314
+ kind: "CaseNode",
1315
+ value: this.transformNode(node.value, queryId),
1316
+ when: this.transformNodeList(node.when, queryId),
1317
+ else: this.transformNode(node.else, queryId),
1318
+ isStatement: node.isStatement
1319
+ });
1320
+ }
1321
+ transformWhen(node, queryId) {
1322
+ return requireAllProps({
1323
+ kind: "WhenNode",
1324
+ condition: this.transformNode(node.condition, queryId),
1325
+ result: this.transformNode(node.result, queryId)
1326
+ });
1327
+ }
1328
+ transformJSONReference(node, queryId) {
1329
+ return requireAllProps({
1330
+ kind: "JSONReferenceNode",
1331
+ reference: this.transformNode(node.reference, queryId),
1332
+ traversal: this.transformNode(node.traversal, queryId)
1333
+ });
1334
+ }
1335
+ transformJSONPath(node, queryId) {
1336
+ return requireAllProps({
1337
+ kind: "JSONPathNode",
1338
+ inOperator: this.transformNode(node.inOperator, queryId),
1339
+ pathLegs: this.transformNodeList(node.pathLegs, queryId)
1340
+ });
1341
+ }
1342
+ transformJSONPathLeg(node, _queryId) {
1343
+ return requireAllProps({
1344
+ kind: "JSONPathLegNode",
1345
+ type: node.type,
1346
+ value: node.value
1347
+ });
1348
+ }
1349
+ transformJSONOperatorChain(node, queryId) {
1350
+ return requireAllProps({
1351
+ kind: "JSONOperatorChainNode",
1352
+ operator: this.transformNode(node.operator, queryId),
1353
+ values: this.transformNodeList(node.values, queryId)
1354
+ });
1355
+ }
1356
+ transformTuple(node, queryId) {
1357
+ return requireAllProps({
1358
+ kind: "TupleNode",
1359
+ values: this.transformNodeList(node.values, queryId)
1360
+ });
1361
+ }
1362
+ transformMergeQuery(node, queryId) {
1363
+ return requireAllProps({
1364
+ kind: "MergeQueryNode",
1365
+ into: this.transformNode(node.into, queryId),
1366
+ using: this.transformNode(node.using, queryId),
1367
+ whens: this.transformNodeList(node.whens, queryId),
1368
+ with: this.transformNode(node.with, queryId),
1369
+ top: this.transformNode(node.top, queryId),
1370
+ endModifiers: this.transformNodeList(node.endModifiers, queryId),
1371
+ output: this.transformNode(node.output, queryId),
1372
+ returning: this.transformNode(node.returning, queryId)
1373
+ });
1374
+ }
1375
+ transformMatched(node, _queryId) {
1376
+ return requireAllProps({
1377
+ kind: "MatchedNode",
1378
+ not: node.not,
1379
+ bySource: node.bySource
1380
+ });
1381
+ }
1382
+ transformAddIndex(node, queryId) {
1383
+ return requireAllProps({
1384
+ kind: "AddIndexNode",
1385
+ name: this.transformNode(node.name, queryId),
1386
+ columns: this.transformNodeList(node.columns, queryId),
1387
+ unique: node.unique,
1388
+ using: this.transformNode(node.using, queryId),
1389
+ ifNotExists: node.ifNotExists
1390
+ });
1391
+ }
1392
+ transformCast(node, queryId) {
1393
+ return requireAllProps({
1394
+ kind: "CastNode",
1395
+ expression: this.transformNode(node.expression, queryId),
1396
+ dataType: this.transformNode(node.dataType, queryId)
1397
+ });
1398
+ }
1399
+ transformFetch(node, queryId) {
1400
+ return requireAllProps({
1401
+ kind: "FetchNode",
1402
+ rowCount: this.transformNode(node.rowCount, queryId),
1403
+ modifier: node.modifier
1404
+ });
1405
+ }
1406
+ transformTop(node, _queryId) {
1407
+ return requireAllProps({
1408
+ kind: "TopNode",
1409
+ expression: node.expression,
1410
+ modifiers: node.modifiers
1411
+ });
1412
+ }
1413
+ transformOutput(node, queryId) {
1414
+ return requireAllProps({
1415
+ kind: "OutputNode",
1416
+ selections: this.transformNodeList(node.selections, queryId)
1417
+ });
1418
+ }
1419
+ transformDataType(node, _queryId) {
1420
+ return node;
1421
+ }
1422
+ transformSelectAll(node, _queryId) {
1423
+ return node;
1424
+ }
1425
+ transformIdentifier(node, _queryId) {
1426
+ return node;
1427
+ }
1428
+ transformValue(node, _queryId) {
1429
+ return node;
1430
+ }
1431
+ transformPrimitiveValueList(node, _queryId) {
1432
+ return node;
1433
+ }
1434
+ transformOperator(node, _queryId) {
1435
+ return node;
1436
+ }
1437
+ transformDefaultInsertValue(node, _queryId) {
1438
+ return node;
1439
+ }
1440
+ transformOrAction(node, _queryId) {
1441
+ return node;
1442
+ }
1443
+ transformCollate(node, _queryId) {
1444
+ return node;
1445
+ }
1446
+ };
1447
+ //#endregion
1448
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/plugin/with-schema/with-schema-transformer.js
1449
+ var ROOT_OPERATION_NODES = freeze({
1450
+ AlterTableNode: true,
1451
+ CreateIndexNode: true,
1452
+ CreateSchemaNode: true,
1453
+ CreateTableNode: true,
1454
+ CreateTypeNode: true,
1455
+ CreateViewNode: true,
1456
+ RefreshMaterializedViewNode: true,
1457
+ DeleteQueryNode: true,
1458
+ DropIndexNode: true,
1459
+ DropSchemaNode: true,
1460
+ DropTableNode: true,
1461
+ DropTypeNode: true,
1462
+ DropViewNode: true,
1463
+ InsertQueryNode: true,
1464
+ RawNode: true,
1465
+ SelectQueryNode: true,
1466
+ UpdateQueryNode: true,
1467
+ MergeQueryNode: true
1468
+ });
1469
+ var SCHEMALESS_FUNCTIONS = {
1470
+ json_agg: true,
1471
+ to_json: true
1472
+ };
1473
+ var WithSchemaTransformer = class extends OperationNodeTransformer {
1474
+ #schema;
1475
+ #schemableIds = /* @__PURE__ */ new Set();
1476
+ #ctes = /* @__PURE__ */ new Set();
1477
+ constructor(schema) {
1478
+ super();
1479
+ this.#schema = schema;
1480
+ }
1481
+ transformNodeImpl(node, queryId) {
1482
+ if (!this.#isRootOperationNode(node)) return super.transformNodeImpl(node, queryId);
1483
+ const ctes = this.#collectCTEs(node);
1484
+ for (const cte of ctes) this.#ctes.add(cte);
1485
+ const tables = this.#collectSchemableIds(node);
1486
+ for (const table of tables) this.#schemableIds.add(table);
1487
+ const transformed = super.transformNodeImpl(node, queryId);
1488
+ for (const table of tables) this.#schemableIds.delete(table);
1489
+ for (const cte of ctes) this.#ctes.delete(cte);
1490
+ return transformed;
1491
+ }
1492
+ transformSchemableIdentifier(node, queryId) {
1493
+ const transformed = super.transformSchemableIdentifier(node, queryId);
1494
+ if (transformed.schema || !this.#schemableIds.has(node.identifier.name)) return transformed;
1495
+ return {
1496
+ ...transformed,
1497
+ schema: IdentifierNode.create(this.#schema)
1498
+ };
1499
+ }
1500
+ transformReferences(node, queryId) {
1501
+ const transformed = super.transformReferences(node, queryId);
1502
+ if (transformed.table.table.schema) return transformed;
1503
+ return {
1504
+ ...transformed,
1505
+ table: TableNode.createWithSchema(this.#schema, transformed.table.table.identifier.name)
1506
+ };
1507
+ }
1508
+ transformAggregateFunction(node, queryId) {
1509
+ return {
1510
+ ...super.transformAggregateFunction({
1511
+ ...node,
1512
+ aggregated: []
1513
+ }, queryId),
1514
+ aggregated: this.#transformTableArgsWithoutSchemas(node, queryId, "aggregated")
1515
+ };
1516
+ }
1517
+ transformFunction(node, queryId) {
1518
+ return {
1519
+ ...super.transformFunction({
1520
+ ...node,
1521
+ arguments: []
1522
+ }, queryId),
1523
+ arguments: this.#transformTableArgsWithoutSchemas(node, queryId, "arguments")
1524
+ };
1525
+ }
1526
+ transformSelectModifier(node, queryId) {
1527
+ return {
1528
+ ...super.transformSelectModifier({
1529
+ ...node,
1530
+ of: void 0
1531
+ }, queryId),
1532
+ of: node.of?.map((item) => TableNode.is(item) && !item.table.schema ? {
1533
+ ...item,
1534
+ table: this.transformIdentifier(item.table.identifier, queryId)
1535
+ } : this.transformNode(item, queryId))
1536
+ };
1537
+ }
1538
+ #transformTableArgsWithoutSchemas(node, queryId, argsKey) {
1539
+ return SCHEMALESS_FUNCTIONS[node.func] ? node[argsKey].map((arg) => !TableNode.is(arg) || arg.table.schema ? this.transformNode(arg, queryId) : {
1540
+ ...arg,
1541
+ table: this.transformIdentifier(arg.table.identifier, queryId)
1542
+ }) : this.transformNodeList(node[argsKey], queryId);
1543
+ }
1544
+ #isRootOperationNode(node) {
1545
+ return node.kind in ROOT_OPERATION_NODES;
1546
+ }
1547
+ #collectSchemableIds(node) {
1548
+ const schemableIds = /* @__PURE__ */ new Set();
1549
+ if ("name" in node && node.name && SchemableIdentifierNode.is(node.name)) this.#collectSchemableId(node.name, schemableIds);
1550
+ if ("from" in node && node.from) for (const from of node.from.froms) this.#collectSchemableIdsFromTableExpr(from, schemableIds);
1551
+ if ("into" in node && node.into) this.#collectSchemableIdsFromTableExpr(node.into, schemableIds);
1552
+ if ("table" in node && node.table) this.#collectSchemableIdsFromTableExpr(node.table, schemableIds);
1553
+ if ("joins" in node && node.joins) for (const join of node.joins) this.#collectSchemableIdsFromTableExpr(join.table, schemableIds);
1554
+ if ("using" in node && node.using) if (JoinNode.is(node.using)) this.#collectSchemableIdsFromTableExpr(node.using.table, schemableIds);
1555
+ else this.#collectSchemableIdsFromTableExpr(node.using, schemableIds);
1556
+ return schemableIds;
1557
+ }
1558
+ #collectCTEs(node) {
1559
+ const ctes = /* @__PURE__ */ new Set();
1560
+ if ("with" in node && node.with) this.#collectCTEIds(node.with, ctes);
1561
+ return ctes;
1562
+ }
1563
+ #collectSchemableIdsFromTableExpr(node, schemableIds) {
1564
+ if (TableNode.is(node)) return this.#collectSchemableId(node.table, schemableIds);
1565
+ if (AliasNode.is(node) && TableNode.is(node.node)) return this.#collectSchemableId(node.node.table, schemableIds);
1566
+ if (ListNode.is(node)) {
1567
+ for (const table of node.items) this.#collectSchemableIdsFromTableExpr(table, schemableIds);
1568
+ return;
1569
+ }
1570
+ if (UsingNode.is(node)) {
1571
+ for (const table of node.tables) this.#collectSchemableIdsFromTableExpr(table, schemableIds);
1572
+ return;
1573
+ }
1574
+ }
1575
+ #collectSchemableId(node, schemableIds) {
1576
+ const id = node.identifier.name;
1577
+ if (!this.#schemableIds.has(id) && !this.#ctes.has(id)) schemableIds.add(id);
1578
+ }
1579
+ #collectCTEIds(node, ctes) {
1580
+ for (const expr of node.expressions) {
1581
+ const cteId = expr.name.table.table.identifier.name;
1582
+ if (!this.#ctes.has(cteId)) ctes.add(cteId);
1583
+ }
1584
+ }
1585
+ };
1586
+ //#endregion
1587
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/plugin/with-schema/with-schema-plugin.js
1588
+ var WithSchemaPlugin = class {
1589
+ #transformer;
1590
+ constructor(schema) {
1591
+ this.#transformer = new WithSchemaTransformer(schema);
1592
+ }
1593
+ transformQuery(args) {
1594
+ return this.#transformer.transformNode(args.node, args.queryId);
1595
+ }
1596
+ async transformResult(args) {
1597
+ return args.result;
1598
+ }
1599
+ };
1600
+ //#endregion
1601
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/set-operation-node.js
1602
+ /**
1603
+ * @internal
1604
+ */
1605
+ var SetOperationNode = freeze({
1606
+ is(node) {
1607
+ return node.kind === "SetOperationNode";
1608
+ },
1609
+ create(operator, expression, all) {
1610
+ return freeze({
1611
+ kind: "SetOperationNode",
1612
+ operator,
1613
+ expression,
1614
+ all
1615
+ });
1616
+ }
1617
+ });
1618
+ //#endregion
1619
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/create-view-node.js
1620
+ /**
1621
+ * @internal
1622
+ */
1623
+ var CreateViewNode = freeze({
1624
+ is(node) {
1625
+ return node.kind === "CreateViewNode";
1626
+ },
1627
+ create(name) {
1628
+ return freeze({
1629
+ kind: "CreateViewNode",
1630
+ name: SchemableIdentifierNode.create(name)
1631
+ });
1632
+ },
1633
+ cloneWith(createView, params) {
1634
+ return freeze({
1635
+ ...createView,
1636
+ ...params
1637
+ });
1638
+ }
1639
+ });
1640
+ //#endregion
1641
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/operation-node/operation-node-visitor.js
1642
+ var OperationNodeVisitor = class {
1643
+ nodeStack = [];
1644
+ get parentNode() {
1645
+ return this.nodeStack[this.nodeStack.length - 2];
1646
+ }
1647
+ #visitors = freeze({
1648
+ AliasNode: this.visitAlias.bind(this),
1649
+ ColumnNode: this.visitColumn.bind(this),
1650
+ IdentifierNode: this.visitIdentifier.bind(this),
1651
+ SchemableIdentifierNode: this.visitSchemableIdentifier.bind(this),
1652
+ RawNode: this.visitRaw.bind(this),
1653
+ ReferenceNode: this.visitReference.bind(this),
1654
+ SelectQueryNode: this.visitSelectQuery.bind(this),
1655
+ SelectionNode: this.visitSelection.bind(this),
1656
+ TableNode: this.visitTable.bind(this),
1657
+ FromNode: this.visitFrom.bind(this),
1658
+ SelectAllNode: this.visitSelectAll.bind(this),
1659
+ AndNode: this.visitAnd.bind(this),
1660
+ OrNode: this.visitOr.bind(this),
1661
+ ValueNode: this.visitValue.bind(this),
1662
+ ValueListNode: this.visitValueList.bind(this),
1663
+ PrimitiveValueListNode: this.visitPrimitiveValueList.bind(this),
1664
+ ParensNode: this.visitParens.bind(this),
1665
+ JoinNode: this.visitJoin.bind(this),
1666
+ OperatorNode: this.visitOperator.bind(this),
1667
+ WhereNode: this.visitWhere.bind(this),
1668
+ InsertQueryNode: this.visitInsertQuery.bind(this),
1669
+ DeleteQueryNode: this.visitDeleteQuery.bind(this),
1670
+ ReturningNode: this.visitReturning.bind(this),
1671
+ CreateTableNode: this.visitCreateTable.bind(this),
1672
+ AddColumnNode: this.visitAddColumn.bind(this),
1673
+ ColumnDefinitionNode: this.visitColumnDefinition.bind(this),
1674
+ DropTableNode: this.visitDropTable.bind(this),
1675
+ DataTypeNode: this.visitDataType.bind(this),
1676
+ OrderByNode: this.visitOrderBy.bind(this),
1677
+ OrderByItemNode: this.visitOrderByItem.bind(this),
1678
+ GroupByNode: this.visitGroupBy.bind(this),
1679
+ GroupByItemNode: this.visitGroupByItem.bind(this),
1680
+ UpdateQueryNode: this.visitUpdateQuery.bind(this),
1681
+ ColumnUpdateNode: this.visitColumnUpdate.bind(this),
1682
+ LimitNode: this.visitLimit.bind(this),
1683
+ OffsetNode: this.visitOffset.bind(this),
1684
+ OnConflictNode: this.visitOnConflict.bind(this),
1685
+ OnDuplicateKeyNode: this.visitOnDuplicateKey.bind(this),
1686
+ CreateIndexNode: this.visitCreateIndex.bind(this),
1687
+ DropIndexNode: this.visitDropIndex.bind(this),
1688
+ ListNode: this.visitList.bind(this),
1689
+ PrimaryKeyConstraintNode: this.visitPrimaryKeyConstraint.bind(this),
1690
+ UniqueConstraintNode: this.visitUniqueConstraint.bind(this),
1691
+ ReferencesNode: this.visitReferences.bind(this),
1692
+ CheckConstraintNode: this.visitCheckConstraint.bind(this),
1693
+ WithNode: this.visitWith.bind(this),
1694
+ CommonTableExpressionNode: this.visitCommonTableExpression.bind(this),
1695
+ CommonTableExpressionNameNode: this.visitCommonTableExpressionName.bind(this),
1696
+ HavingNode: this.visitHaving.bind(this),
1697
+ CreateSchemaNode: this.visitCreateSchema.bind(this),
1698
+ DropSchemaNode: this.visitDropSchema.bind(this),
1699
+ AlterTableNode: this.visitAlterTable.bind(this),
1700
+ DropColumnNode: this.visitDropColumn.bind(this),
1701
+ RenameColumnNode: this.visitRenameColumn.bind(this),
1702
+ AlterColumnNode: this.visitAlterColumn.bind(this),
1703
+ ModifyColumnNode: this.visitModifyColumn.bind(this),
1704
+ AddConstraintNode: this.visitAddConstraint.bind(this),
1705
+ DropConstraintNode: this.visitDropConstraint.bind(this),
1706
+ RenameConstraintNode: this.visitRenameConstraint.bind(this),
1707
+ ForeignKeyConstraintNode: this.visitForeignKeyConstraint.bind(this),
1708
+ CreateViewNode: this.visitCreateView.bind(this),
1709
+ RefreshMaterializedViewNode: this.visitRefreshMaterializedView.bind(this),
1710
+ DropViewNode: this.visitDropView.bind(this),
1711
+ GeneratedNode: this.visitGenerated.bind(this),
1712
+ DefaultValueNode: this.visitDefaultValue.bind(this),
1713
+ OnNode: this.visitOn.bind(this),
1714
+ ValuesNode: this.visitValues.bind(this),
1715
+ SelectModifierNode: this.visitSelectModifier.bind(this),
1716
+ CreateTypeNode: this.visitCreateType.bind(this),
1717
+ DropTypeNode: this.visitDropType.bind(this),
1718
+ ExplainNode: this.visitExplain.bind(this),
1719
+ DefaultInsertValueNode: this.visitDefaultInsertValue.bind(this),
1720
+ AggregateFunctionNode: this.visitAggregateFunction.bind(this),
1721
+ OverNode: this.visitOver.bind(this),
1722
+ PartitionByNode: this.visitPartitionBy.bind(this),
1723
+ PartitionByItemNode: this.visitPartitionByItem.bind(this),
1724
+ SetOperationNode: this.visitSetOperation.bind(this),
1725
+ BinaryOperationNode: this.visitBinaryOperation.bind(this),
1726
+ UnaryOperationNode: this.visitUnaryOperation.bind(this),
1727
+ UsingNode: this.visitUsing.bind(this),
1728
+ FunctionNode: this.visitFunction.bind(this),
1729
+ CaseNode: this.visitCase.bind(this),
1730
+ WhenNode: this.visitWhen.bind(this),
1731
+ JSONReferenceNode: this.visitJSONReference.bind(this),
1732
+ JSONPathNode: this.visitJSONPath.bind(this),
1733
+ JSONPathLegNode: this.visitJSONPathLeg.bind(this),
1734
+ JSONOperatorChainNode: this.visitJSONOperatorChain.bind(this),
1735
+ TupleNode: this.visitTuple.bind(this),
1736
+ MergeQueryNode: this.visitMergeQuery.bind(this),
1737
+ MatchedNode: this.visitMatched.bind(this),
1738
+ AddIndexNode: this.visitAddIndex.bind(this),
1739
+ CastNode: this.visitCast.bind(this),
1740
+ FetchNode: this.visitFetch.bind(this),
1741
+ TopNode: this.visitTop.bind(this),
1742
+ OutputNode: this.visitOutput.bind(this),
1743
+ OrActionNode: this.visitOrAction.bind(this),
1744
+ CollateNode: this.visitCollate.bind(this)
1745
+ });
1746
+ visitNode = (node) => {
1747
+ this.nodeStack.push(node);
1748
+ this.#visitors[node.kind](node);
1749
+ this.nodeStack.pop();
1750
+ };
1751
+ };
1752
+ //#endregion
1753
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/query-compiler/default-query-compiler.js
1754
+ var LIT_WRAP_REGEX = /'/g;
1755
+ var DefaultQueryCompiler = class extends OperationNodeVisitor {
1756
+ #sql = "";
1757
+ #parameters = [];
1758
+ get numParameters() {
1759
+ return this.#parameters.length;
1760
+ }
1761
+ compileQuery(node, queryId) {
1762
+ this.#sql = "";
1763
+ this.#parameters = [];
1764
+ this.nodeStack.splice(0, this.nodeStack.length);
1765
+ this.visitNode(node);
1766
+ return freeze({
1767
+ query: node,
1768
+ queryId,
1769
+ sql: this.getSql(),
1770
+ parameters: [...this.#parameters]
1771
+ });
1772
+ }
1773
+ getSql() {
1774
+ return this.#sql;
1775
+ }
1776
+ visitSelectQuery(node) {
1777
+ const wrapInParens = this.parentNode !== void 0 && !ParensNode.is(this.parentNode) && !InsertQueryNode.is(this.parentNode) && !CreateTableNode.is(this.parentNode) && !CreateViewNode.is(this.parentNode) && !SetOperationNode.is(this.parentNode);
1778
+ if (this.parentNode === void 0 && node.explain) {
1779
+ this.visitNode(node.explain);
1780
+ this.append(" ");
1781
+ }
1782
+ if (wrapInParens) this.append("(");
1783
+ if (node.with) {
1784
+ this.visitNode(node.with);
1785
+ this.append(" ");
1786
+ }
1787
+ this.append("select");
1788
+ if (node.distinctOn) {
1789
+ this.append(" ");
1790
+ this.compileDistinctOn(node.distinctOn);
1791
+ }
1792
+ if (node.frontModifiers?.length) {
1793
+ this.append(" ");
1794
+ this.compileList(node.frontModifiers, " ");
1795
+ }
1796
+ if (node.top) {
1797
+ this.append(" ");
1798
+ this.visitNode(node.top);
1799
+ }
1800
+ if (node.selections) {
1801
+ this.append(" ");
1802
+ this.compileList(node.selections);
1803
+ }
1804
+ if (node.from) {
1805
+ this.append(" ");
1806
+ this.visitNode(node.from);
1807
+ }
1808
+ if (node.joins) {
1809
+ this.append(" ");
1810
+ this.compileList(node.joins, " ");
1811
+ }
1812
+ if (node.where) {
1813
+ this.append(" ");
1814
+ this.visitNode(node.where);
1815
+ }
1816
+ if (node.groupBy) {
1817
+ this.append(" ");
1818
+ this.visitNode(node.groupBy);
1819
+ }
1820
+ if (node.having) {
1821
+ this.append(" ");
1822
+ this.visitNode(node.having);
1823
+ }
1824
+ if (node.setOperations) {
1825
+ this.append(" ");
1826
+ this.compileList(node.setOperations, " ");
1827
+ }
1828
+ if (node.orderBy) {
1829
+ this.append(" ");
1830
+ this.visitNode(node.orderBy);
1831
+ }
1832
+ if (node.limit) {
1833
+ this.append(" ");
1834
+ this.visitNode(node.limit);
1835
+ }
1836
+ if (node.offset) {
1837
+ this.append(" ");
1838
+ this.visitNode(node.offset);
1839
+ }
1840
+ if (node.fetch) {
1841
+ this.append(" ");
1842
+ this.visitNode(node.fetch);
1843
+ }
1844
+ if (node.endModifiers?.length) {
1845
+ this.append(" ");
1846
+ this.compileList(this.sortSelectModifiers([...node.endModifiers]), " ");
1847
+ }
1848
+ if (wrapInParens) this.append(")");
1849
+ }
1850
+ visitFrom(node) {
1851
+ this.append("from ");
1852
+ this.compileList(node.froms);
1853
+ }
1854
+ visitSelection(node) {
1855
+ this.visitNode(node.selection);
1856
+ }
1857
+ visitColumn(node) {
1858
+ this.visitNode(node.column);
1859
+ }
1860
+ compileDistinctOn(expressions) {
1861
+ this.append("distinct on (");
1862
+ this.compileList(expressions);
1863
+ this.append(")");
1864
+ }
1865
+ compileList(nodes, separator = ", ") {
1866
+ const lastIndex = nodes.length - 1;
1867
+ for (let i = 0; i <= lastIndex; i++) {
1868
+ this.visitNode(nodes[i]);
1869
+ if (i < lastIndex) this.append(separator);
1870
+ }
1871
+ }
1872
+ visitWhere(node) {
1873
+ this.append("where ");
1874
+ this.visitNode(node.where);
1875
+ }
1876
+ visitHaving(node) {
1877
+ this.append("having ");
1878
+ this.visitNode(node.having);
1879
+ }
1880
+ visitInsertQuery(node) {
1881
+ const wrapInParens = this.parentNode !== void 0 && !ParensNode.is(this.parentNode) && !RawNode.is(this.parentNode) && !WhenNode.is(this.parentNode);
1882
+ if (this.parentNode === void 0 && node.explain) {
1883
+ this.visitNode(node.explain);
1884
+ this.append(" ");
1885
+ }
1886
+ if (wrapInParens) this.append("(");
1887
+ if (node.with) {
1888
+ this.visitNode(node.with);
1889
+ this.append(" ");
1890
+ }
1891
+ this.append(node.replace ? "replace" : "insert");
1892
+ if (node.ignore) {
1893
+ logOnce("`InsertQueryNode.ignore` is deprecated. Use `InsertQueryNode.orAction` instead.");
1894
+ this.append(" ignore");
1895
+ }
1896
+ if (node.orAction) {
1897
+ this.append(" ");
1898
+ this.visitNode(node.orAction);
1899
+ }
1900
+ if (node.top) {
1901
+ this.append(" ");
1902
+ this.visitNode(node.top);
1903
+ }
1904
+ if (node.into) {
1905
+ this.append(" into ");
1906
+ this.visitNode(node.into);
1907
+ }
1908
+ if (node.columns) {
1909
+ this.append(" (");
1910
+ this.compileList(node.columns);
1911
+ this.append(")");
1912
+ }
1913
+ if (node.output) {
1914
+ this.append(" ");
1915
+ this.visitNode(node.output);
1916
+ }
1917
+ if (node.values) {
1918
+ this.append(" ");
1919
+ this.visitNode(node.values);
1920
+ }
1921
+ if (node.defaultValues) {
1922
+ this.append(" ");
1923
+ this.append("default values");
1924
+ }
1925
+ if (node.onConflict) {
1926
+ this.append(" ");
1927
+ this.visitNode(node.onConflict);
1928
+ }
1929
+ if (node.onDuplicateKey) {
1930
+ this.append(" ");
1931
+ this.visitNode(node.onDuplicateKey);
1932
+ }
1933
+ if (node.returning) {
1934
+ this.append(" ");
1935
+ this.visitNode(node.returning);
1936
+ }
1937
+ if (wrapInParens) this.append(")");
1938
+ if (node.endModifiers?.length) {
1939
+ this.append(" ");
1940
+ this.compileList(node.endModifiers, " ");
1941
+ }
1942
+ }
1943
+ visitValues(node) {
1944
+ this.append("values ");
1945
+ this.compileList(node.values);
1946
+ }
1947
+ visitDeleteQuery(node) {
1948
+ const wrapInParens = this.parentNode !== void 0 && !ParensNode.is(this.parentNode) && !RawNode.is(this.parentNode);
1949
+ if (this.parentNode === void 0 && node.explain) {
1950
+ this.visitNode(node.explain);
1951
+ this.append(" ");
1952
+ }
1953
+ if (wrapInParens) this.append("(");
1954
+ if (node.with) {
1955
+ this.visitNode(node.with);
1956
+ this.append(" ");
1957
+ }
1958
+ this.append("delete ");
1959
+ if (node.top) {
1960
+ this.visitNode(node.top);
1961
+ this.append(" ");
1962
+ }
1963
+ this.visitNode(node.from);
1964
+ if (node.output) {
1965
+ this.append(" ");
1966
+ this.visitNode(node.output);
1967
+ }
1968
+ if (node.using) {
1969
+ this.append(" ");
1970
+ this.visitNode(node.using);
1971
+ }
1972
+ if (node.joins) {
1973
+ this.append(" ");
1974
+ this.compileList(node.joins, " ");
1975
+ }
1976
+ if (node.where) {
1977
+ this.append(" ");
1978
+ this.visitNode(node.where);
1979
+ }
1980
+ if (node.orderBy) {
1981
+ this.append(" ");
1982
+ this.visitNode(node.orderBy);
1983
+ }
1984
+ if (node.limit) {
1985
+ this.append(" ");
1986
+ this.visitNode(node.limit);
1987
+ }
1988
+ if (node.returning) {
1989
+ this.append(" ");
1990
+ this.visitNode(node.returning);
1991
+ }
1992
+ if (wrapInParens) this.append(")");
1993
+ if (node.endModifiers?.length) {
1994
+ this.append(" ");
1995
+ this.compileList(node.endModifiers, " ");
1996
+ }
1997
+ }
1998
+ visitReturning(node) {
1999
+ this.append("returning ");
2000
+ this.compileList(node.selections);
2001
+ }
2002
+ visitAlias(node) {
2003
+ this.visitNode(node.node);
2004
+ this.append(" as ");
2005
+ this.visitNode(node.alias);
2006
+ }
2007
+ visitReference(node) {
2008
+ if (node.table) {
2009
+ this.visitNode(node.table);
2010
+ this.append(".");
2011
+ }
2012
+ this.visitNode(node.column);
2013
+ }
2014
+ visitSelectAll(_) {
2015
+ this.append("*");
2016
+ }
2017
+ visitIdentifier(node) {
2018
+ this.append(this.getLeftIdentifierWrapper());
2019
+ this.compileUnwrappedIdentifier(node);
2020
+ this.append(this.getRightIdentifierWrapper());
2021
+ }
2022
+ compileUnwrappedIdentifier(node) {
2023
+ if (!isString(node.name)) throw new Error("a non-string identifier was passed to compileUnwrappedIdentifier.");
2024
+ this.append(this.sanitizeIdentifier(node.name));
2025
+ }
2026
+ visitAnd(node) {
2027
+ this.visitNode(node.left);
2028
+ this.append(" and ");
2029
+ this.visitNode(node.right);
2030
+ }
2031
+ visitOr(node) {
2032
+ this.visitNode(node.left);
2033
+ this.append(" or ");
2034
+ this.visitNode(node.right);
2035
+ }
2036
+ visitValue(node) {
2037
+ if (node.immediate) this.appendImmediateValue(node.value);
2038
+ else this.appendValue(node.value);
2039
+ }
2040
+ visitValueList(node) {
2041
+ this.append("(");
2042
+ this.compileList(node.values);
2043
+ this.append(")");
2044
+ }
2045
+ visitTuple(node) {
2046
+ this.append("(");
2047
+ this.compileList(node.values);
2048
+ this.append(")");
2049
+ }
2050
+ visitPrimitiveValueList(node) {
2051
+ this.append("(");
2052
+ const { values } = node;
2053
+ for (let i = 0; i < values.length; ++i) {
2054
+ this.appendValue(values[i]);
2055
+ if (i !== values.length - 1) this.append(", ");
2056
+ }
2057
+ this.append(")");
2058
+ }
2059
+ visitParens(node) {
2060
+ this.append("(");
2061
+ this.visitNode(node.node);
2062
+ this.append(")");
2063
+ }
2064
+ visitJoin(node) {
2065
+ this.append(JOIN_TYPE_SQL[node.joinType]);
2066
+ this.append(" ");
2067
+ this.visitNode(node.table);
2068
+ if (node.on) {
2069
+ this.append(" ");
2070
+ this.visitNode(node.on);
2071
+ }
2072
+ }
2073
+ visitOn(node) {
2074
+ this.append("on ");
2075
+ this.visitNode(node.on);
2076
+ }
2077
+ visitRaw(node) {
2078
+ const { sqlFragments, parameters: params } = node;
2079
+ for (let i = 0; i < sqlFragments.length; ++i) {
2080
+ this.append(sqlFragments[i]);
2081
+ if (params.length > i) this.visitNode(params[i]);
2082
+ }
2083
+ }
2084
+ visitOperator(node) {
2085
+ this.append(node.operator);
2086
+ }
2087
+ visitTable(node) {
2088
+ this.visitNode(node.table);
2089
+ }
2090
+ visitSchemableIdentifier(node) {
2091
+ if (node.schema) {
2092
+ this.visitNode(node.schema);
2093
+ this.append(".");
2094
+ }
2095
+ this.visitNode(node.identifier);
2096
+ }
2097
+ visitCreateTable(node) {
2098
+ this.append("create ");
2099
+ if (node.frontModifiers?.length) {
2100
+ this.compileList(node.frontModifiers, " ");
2101
+ this.append(" ");
2102
+ }
2103
+ if (node.temporary) this.append("temporary ");
2104
+ this.append("table ");
2105
+ if (node.ifNotExists) this.append("if not exists ");
2106
+ this.visitNode(node.table);
2107
+ if (!node.selectQuery) {
2108
+ this.append(" (");
2109
+ this.compileList([...node.columns, ...node.constraints ?? []]);
2110
+ this.append(")");
2111
+ }
2112
+ if (node.onCommit) {
2113
+ this.append(" on commit ");
2114
+ this.append(node.onCommit);
2115
+ }
2116
+ if (node.endModifiers?.length) {
2117
+ this.append(" ");
2118
+ this.compileList(node.endModifiers, " ");
2119
+ }
2120
+ if (node.selectQuery) {
2121
+ this.append(" as ");
2122
+ this.visitNode(node.selectQuery);
2123
+ }
2124
+ }
2125
+ visitColumnDefinition(node) {
2126
+ if (node.ifNotExists) this.append("if not exists ");
2127
+ this.visitNode(node.column);
2128
+ this.append(" ");
2129
+ this.visitNode(node.dataType);
2130
+ if (node.unsigned) this.append(" unsigned");
2131
+ if (node.frontModifiers && node.frontModifiers.length > 0) {
2132
+ this.append(" ");
2133
+ this.compileList(node.frontModifiers, " ");
2134
+ }
2135
+ if (node.generated) {
2136
+ this.append(" ");
2137
+ this.visitNode(node.generated);
2138
+ }
2139
+ if (node.identity) this.append(" identity");
2140
+ if (node.defaultTo) {
2141
+ this.append(" ");
2142
+ this.visitNode(node.defaultTo);
2143
+ }
2144
+ if (node.notNull) this.append(" not null");
2145
+ if (node.unique) this.append(" unique");
2146
+ if (node.nullsNotDistinct) this.append(" nulls not distinct");
2147
+ if (node.primaryKey) this.append(" primary key");
2148
+ if (node.autoIncrement) {
2149
+ this.append(" ");
2150
+ this.append(this.getAutoIncrement());
2151
+ }
2152
+ if (node.references) {
2153
+ this.append(" ");
2154
+ this.visitNode(node.references);
2155
+ }
2156
+ if (node.check) {
2157
+ this.append(" ");
2158
+ this.visitNode(node.check);
2159
+ }
2160
+ if (node.endModifiers && node.endModifiers.length > 0) {
2161
+ this.append(" ");
2162
+ this.compileList(node.endModifiers, " ");
2163
+ }
2164
+ }
2165
+ getAutoIncrement() {
2166
+ return "auto_increment";
2167
+ }
2168
+ visitReferences(node) {
2169
+ this.append("references ");
2170
+ this.visitNode(node.table);
2171
+ this.append(" (");
2172
+ this.compileList(node.columns);
2173
+ this.append(")");
2174
+ if (node.onDelete) {
2175
+ this.append(" on delete ");
2176
+ this.append(node.onDelete);
2177
+ }
2178
+ if (node.onUpdate) {
2179
+ this.append(" on update ");
2180
+ this.append(node.onUpdate);
2181
+ }
2182
+ }
2183
+ visitDropTable(node) {
2184
+ this.append("drop table ");
2185
+ if (node.ifExists) this.append("if exists ");
2186
+ this.visitNode(node.table);
2187
+ if (node.cascade) this.append(" cascade");
2188
+ }
2189
+ visitDataType(node) {
2190
+ this.append(node.dataType);
2191
+ }
2192
+ visitOrderBy(node) {
2193
+ this.append("order by ");
2194
+ this.compileList(node.items);
2195
+ }
2196
+ visitOrderByItem(node) {
2197
+ this.visitNode(node.orderBy);
2198
+ if (node.collation) {
2199
+ this.append(" ");
2200
+ this.visitNode(node.collation);
2201
+ }
2202
+ if (node.direction) {
2203
+ this.append(" ");
2204
+ this.visitNode(node.direction);
2205
+ }
2206
+ if (node.nulls) {
2207
+ this.append(" nulls ");
2208
+ this.append(node.nulls);
2209
+ }
2210
+ }
2211
+ visitGroupBy(node) {
2212
+ this.append("group by ");
2213
+ this.compileList(node.items);
2214
+ }
2215
+ visitGroupByItem(node) {
2216
+ this.visitNode(node.groupBy);
2217
+ }
2218
+ visitUpdateQuery(node) {
2219
+ const wrapInParens = this.parentNode !== void 0 && !ParensNode.is(this.parentNode) && !RawNode.is(this.parentNode) && !WhenNode.is(this.parentNode);
2220
+ if (this.parentNode === void 0 && node.explain) {
2221
+ this.visitNode(node.explain);
2222
+ this.append(" ");
2223
+ }
2224
+ if (wrapInParens) this.append("(");
2225
+ if (node.with) {
2226
+ this.visitNode(node.with);
2227
+ this.append(" ");
2228
+ }
2229
+ this.append("update ");
2230
+ if (node.top) {
2231
+ this.visitNode(node.top);
2232
+ this.append(" ");
2233
+ }
2234
+ if (node.table) {
2235
+ this.visitNode(node.table);
2236
+ this.append(" ");
2237
+ }
2238
+ this.append("set ");
2239
+ if (node.updates) this.compileList(node.updates);
2240
+ if (node.output) {
2241
+ this.append(" ");
2242
+ this.visitNode(node.output);
2243
+ }
2244
+ if (node.from) {
2245
+ this.append(" ");
2246
+ this.visitNode(node.from);
2247
+ }
2248
+ if (node.joins) {
2249
+ if (!node.from) throw new Error("Joins in an update query are only supported as a part of a PostgreSQL 'update set from join' query. If you want to create a MySQL 'update join set' query, see https://kysely.dev/docs/examples/update/my-sql-joins");
2250
+ this.append(" ");
2251
+ this.compileList(node.joins, " ");
2252
+ }
2253
+ if (node.where) {
2254
+ this.append(" ");
2255
+ this.visitNode(node.where);
2256
+ }
2257
+ if (node.returning) {
2258
+ this.append(" ");
2259
+ this.visitNode(node.returning);
2260
+ }
2261
+ if (node.orderBy) {
2262
+ this.append(" ");
2263
+ this.visitNode(node.orderBy);
2264
+ }
2265
+ if (node.limit) {
2266
+ this.append(" ");
2267
+ this.visitNode(node.limit);
2268
+ }
2269
+ if (wrapInParens) this.append(")");
2270
+ if (node.endModifiers?.length) {
2271
+ this.append(" ");
2272
+ this.compileList(node.endModifiers, " ");
2273
+ }
2274
+ }
2275
+ visitColumnUpdate(node) {
2276
+ this.visitNode(node.column);
2277
+ this.append(" = ");
2278
+ this.visitNode(node.value);
2279
+ }
2280
+ visitLimit(node) {
2281
+ this.append("limit ");
2282
+ this.visitNode(node.limit);
2283
+ }
2284
+ visitOffset(node) {
2285
+ this.append("offset ");
2286
+ this.visitNode(node.offset);
2287
+ }
2288
+ visitOnConflict(node) {
2289
+ this.append("on conflict");
2290
+ if (node.columns) {
2291
+ this.append(" (");
2292
+ this.compileList(node.columns);
2293
+ this.append(")");
2294
+ } else if (node.constraint) {
2295
+ this.append(" on constraint ");
2296
+ this.visitNode(node.constraint);
2297
+ } else if (node.indexExpression) {
2298
+ this.append(" (");
2299
+ this.visitNode(node.indexExpression);
2300
+ this.append(")");
2301
+ }
2302
+ if (node.indexWhere) {
2303
+ this.append(" ");
2304
+ this.visitNode(node.indexWhere);
2305
+ }
2306
+ if (node.doNothing === true) this.append(" do nothing");
2307
+ else if (node.updates) {
2308
+ this.append(" do update set ");
2309
+ this.compileList(node.updates);
2310
+ if (node.updateWhere) {
2311
+ this.append(" ");
2312
+ this.visitNode(node.updateWhere);
2313
+ }
2314
+ }
2315
+ }
2316
+ visitOnDuplicateKey(node) {
2317
+ this.append("on duplicate key update ");
2318
+ this.compileList(node.updates);
2319
+ }
2320
+ visitCreateIndex(node) {
2321
+ this.append("create ");
2322
+ if (node.unique) this.append("unique ");
2323
+ this.append("index ");
2324
+ if (node.ifNotExists) this.append("if not exists ");
2325
+ this.visitNode(node.name);
2326
+ if (node.table) {
2327
+ this.append(" on ");
2328
+ this.visitNode(node.table);
2329
+ }
2330
+ if (node.using) {
2331
+ this.append(" using ");
2332
+ this.visitNode(node.using);
2333
+ }
2334
+ if (node.columns) {
2335
+ this.append(" (");
2336
+ this.compileList(node.columns);
2337
+ this.append(")");
2338
+ }
2339
+ if (node.nullsNotDistinct) this.append(" nulls not distinct");
2340
+ if (node.where) {
2341
+ this.append(" ");
2342
+ this.visitNode(node.where);
2343
+ }
2344
+ }
2345
+ visitDropIndex(node) {
2346
+ this.append("drop index ");
2347
+ if (node.ifExists) this.append("if exists ");
2348
+ this.visitNode(node.name);
2349
+ if (node.table) {
2350
+ this.append(" on ");
2351
+ this.visitNode(node.table);
2352
+ }
2353
+ if (node.cascade) this.append(" cascade");
2354
+ }
2355
+ visitCreateSchema(node) {
2356
+ this.append("create schema ");
2357
+ if (node.ifNotExists) this.append("if not exists ");
2358
+ this.visitNode(node.schema);
2359
+ }
2360
+ visitDropSchema(node) {
2361
+ this.append("drop schema ");
2362
+ if (node.ifExists) this.append("if exists ");
2363
+ this.visitNode(node.schema);
2364
+ if (node.cascade) this.append(" cascade");
2365
+ }
2366
+ visitPrimaryKeyConstraint(node) {
2367
+ if (node.name) {
2368
+ this.append("constraint ");
2369
+ this.visitNode(node.name);
2370
+ this.append(" ");
2371
+ }
2372
+ this.append("primary key (");
2373
+ this.compileList(node.columns);
2374
+ this.append(")");
2375
+ this.buildDeferrable(node);
2376
+ }
2377
+ buildDeferrable(node) {
2378
+ if (node.deferrable !== void 0) if (node.deferrable) this.append(" deferrable");
2379
+ else this.append(" not deferrable");
2380
+ if (node.initiallyDeferred !== void 0) if (node.initiallyDeferred) this.append(" initially deferred");
2381
+ else this.append(" initially immediate");
2382
+ }
2383
+ visitUniqueConstraint(node) {
2384
+ if (node.name) {
2385
+ this.append("constraint ");
2386
+ this.visitNode(node.name);
2387
+ this.append(" ");
2388
+ }
2389
+ this.append("unique");
2390
+ if (node.nullsNotDistinct) this.append(" nulls not distinct");
2391
+ this.append(" (");
2392
+ this.compileList(node.columns);
2393
+ this.append(")");
2394
+ this.buildDeferrable(node);
2395
+ }
2396
+ visitCheckConstraint(node) {
2397
+ if (node.name) {
2398
+ this.append("constraint ");
2399
+ this.visitNode(node.name);
2400
+ this.append(" ");
2401
+ }
2402
+ this.append("check (");
2403
+ this.visitNode(node.expression);
2404
+ this.append(")");
2405
+ }
2406
+ visitForeignKeyConstraint(node) {
2407
+ if (node.name) {
2408
+ this.append("constraint ");
2409
+ this.visitNode(node.name);
2410
+ this.append(" ");
2411
+ }
2412
+ this.append("foreign key (");
2413
+ this.compileList(node.columns);
2414
+ this.append(") ");
2415
+ this.visitNode(node.references);
2416
+ if (node.onDelete) {
2417
+ this.append(" on delete ");
2418
+ this.append(node.onDelete);
2419
+ }
2420
+ if (node.onUpdate) {
2421
+ this.append(" on update ");
2422
+ this.append(node.onUpdate);
2423
+ }
2424
+ this.buildDeferrable(node);
2425
+ }
2426
+ visitList(node) {
2427
+ this.compileList(node.items);
2428
+ }
2429
+ visitWith(node) {
2430
+ this.append("with ");
2431
+ if (node.recursive) this.append("recursive ");
2432
+ this.compileList(node.expressions);
2433
+ }
2434
+ visitCommonTableExpression(node) {
2435
+ this.visitNode(node.name);
2436
+ this.append(" as ");
2437
+ if (isBoolean(node.materialized)) {
2438
+ if (!node.materialized) this.append("not ");
2439
+ this.append("materialized ");
2440
+ }
2441
+ this.visitNode(node.expression);
2442
+ }
2443
+ visitCommonTableExpressionName(node) {
2444
+ this.visitNode(node.table);
2445
+ if (node.columns) {
2446
+ this.append("(");
2447
+ this.compileList(node.columns);
2448
+ this.append(")");
2449
+ }
2450
+ }
2451
+ visitAlterTable(node) {
2452
+ this.append("alter table ");
2453
+ this.visitNode(node.table);
2454
+ this.append(" ");
2455
+ if (node.renameTo) {
2456
+ this.append("rename to ");
2457
+ this.visitNode(node.renameTo);
2458
+ }
2459
+ if (node.setSchema) {
2460
+ this.append("set schema ");
2461
+ this.visitNode(node.setSchema);
2462
+ }
2463
+ if (node.addConstraint) this.visitNode(node.addConstraint);
2464
+ if (node.dropConstraint) this.visitNode(node.dropConstraint);
2465
+ if (node.renameConstraint) this.visitNode(node.renameConstraint);
2466
+ if (node.columnAlterations) this.compileColumnAlterations(node.columnAlterations);
2467
+ if (node.addIndex) this.visitNode(node.addIndex);
2468
+ if (node.dropIndex) this.visitNode(node.dropIndex);
2469
+ }
2470
+ visitAddColumn(node) {
2471
+ this.append("add column ");
2472
+ this.visitNode(node.column);
2473
+ }
2474
+ visitRenameColumn(node) {
2475
+ this.append("rename column ");
2476
+ this.visitNode(node.column);
2477
+ this.append(" to ");
2478
+ this.visitNode(node.renameTo);
2479
+ }
2480
+ visitDropColumn(node) {
2481
+ this.append("drop column ");
2482
+ this.visitNode(node.column);
2483
+ }
2484
+ visitAlterColumn(node) {
2485
+ this.append("alter column ");
2486
+ this.visitNode(node.column);
2487
+ this.append(" ");
2488
+ if (node.dataType) {
2489
+ if (this.announcesNewColumnDataType()) this.append("type ");
2490
+ this.visitNode(node.dataType);
2491
+ if (node.dataTypeExpression) {
2492
+ this.append("using ");
2493
+ this.visitNode(node.dataTypeExpression);
2494
+ }
2495
+ }
2496
+ if (node.setDefault) {
2497
+ this.append("set default ");
2498
+ this.visitNode(node.setDefault);
2499
+ }
2500
+ if (node.dropDefault) this.append("drop default");
2501
+ if (node.setNotNull) this.append("set not null");
2502
+ if (node.dropNotNull) this.append("drop not null");
2503
+ }
2504
+ visitModifyColumn(node) {
2505
+ this.append("modify column ");
2506
+ this.visitNode(node.column);
2507
+ }
2508
+ visitAddConstraint(node) {
2509
+ this.append("add ");
2510
+ this.visitNode(node.constraint);
2511
+ }
2512
+ visitDropConstraint(node) {
2513
+ this.append("drop constraint ");
2514
+ if (node.ifExists) this.append("if exists ");
2515
+ this.visitNode(node.constraintName);
2516
+ if (node.modifier === "cascade") this.append(" cascade");
2517
+ else if (node.modifier === "restrict") this.append(" restrict");
2518
+ }
2519
+ visitRenameConstraint(node) {
2520
+ this.append("rename constraint ");
2521
+ this.visitNode(node.oldName);
2522
+ this.append(" to ");
2523
+ this.visitNode(node.newName);
2524
+ }
2525
+ visitSetOperation(node) {
2526
+ this.append(node.operator);
2527
+ this.append(" ");
2528
+ if (node.all) this.append("all ");
2529
+ this.visitNode(node.expression);
2530
+ }
2531
+ visitCreateView(node) {
2532
+ this.append("create ");
2533
+ if (node.orReplace) this.append("or replace ");
2534
+ if (node.materialized) this.append("materialized ");
2535
+ if (node.temporary) this.append("temporary ");
2536
+ this.append("view ");
2537
+ if (node.ifNotExists) this.append("if not exists ");
2538
+ this.visitNode(node.name);
2539
+ this.append(" ");
2540
+ if (node.columns) {
2541
+ this.append("(");
2542
+ this.compileList(node.columns);
2543
+ this.append(") ");
2544
+ }
2545
+ if (node.as) {
2546
+ this.append("as ");
2547
+ this.visitNode(node.as);
2548
+ }
2549
+ }
2550
+ visitRefreshMaterializedView(node) {
2551
+ this.append("refresh materialized view ");
2552
+ if (node.concurrently) this.append("concurrently ");
2553
+ this.visitNode(node.name);
2554
+ if (node.withNoData) this.append(" with no data");
2555
+ else this.append(" with data");
2556
+ }
2557
+ visitDropView(node) {
2558
+ this.append("drop ");
2559
+ if (node.materialized) this.append("materialized ");
2560
+ this.append("view ");
2561
+ if (node.ifExists) this.append("if exists ");
2562
+ this.visitNode(node.name);
2563
+ if (node.cascade) this.append(" cascade");
2564
+ }
2565
+ visitGenerated(node) {
2566
+ this.append("generated ");
2567
+ if (node.always) this.append("always ");
2568
+ if (node.byDefault) this.append("by default ");
2569
+ this.append("as ");
2570
+ if (node.identity) this.append("identity");
2571
+ if (node.expression) {
2572
+ this.append("(");
2573
+ this.visitNode(node.expression);
2574
+ this.append(")");
2575
+ }
2576
+ if (node.stored) this.append(" stored");
2577
+ }
2578
+ visitDefaultValue(node) {
2579
+ this.append("default ");
2580
+ this.visitNode(node.defaultValue);
2581
+ }
2582
+ visitSelectModifier(node) {
2583
+ if (node.rawModifier) this.visitNode(node.rawModifier);
2584
+ else this.append(SELECT_MODIFIER_SQL[node.modifier]);
2585
+ if (node.of) {
2586
+ this.append(" of ");
2587
+ this.compileList(node.of, ", ");
2588
+ }
2589
+ }
2590
+ visitCreateType(node) {
2591
+ this.append("create type ");
2592
+ this.visitNode(node.name);
2593
+ if (node.enum) {
2594
+ this.append(" as enum ");
2595
+ this.visitNode(node.enum);
2596
+ }
2597
+ }
2598
+ visitDropType(node) {
2599
+ this.append("drop type ");
2600
+ if (node.ifExists) this.append("if exists ");
2601
+ this.visitNode(node.name);
2602
+ }
2603
+ visitExplain(node) {
2604
+ this.append("explain");
2605
+ if (node.options || node.format) {
2606
+ this.append(" ");
2607
+ this.append(this.getLeftExplainOptionsWrapper());
2608
+ if (node.options) {
2609
+ this.visitNode(node.options);
2610
+ if (node.format) this.append(this.getExplainOptionsDelimiter());
2611
+ }
2612
+ if (node.format) {
2613
+ this.append("format");
2614
+ this.append(this.getExplainOptionAssignment());
2615
+ this.append(node.format);
2616
+ }
2617
+ this.append(this.getRightExplainOptionsWrapper());
2618
+ }
2619
+ }
2620
+ visitDefaultInsertValue(_) {
2621
+ this.append("default");
2622
+ }
2623
+ visitAggregateFunction(node) {
2624
+ this.append(node.func);
2625
+ this.append("(");
2626
+ if (node.distinct) this.append("distinct ");
2627
+ this.compileList(node.aggregated);
2628
+ if (node.orderBy) {
2629
+ this.append(" ");
2630
+ this.visitNode(node.orderBy);
2631
+ }
2632
+ this.append(")");
2633
+ if (node.withinGroup) {
2634
+ this.append(" within group (");
2635
+ this.visitNode(node.withinGroup);
2636
+ this.append(")");
2637
+ }
2638
+ if (node.filter) {
2639
+ this.append(" filter(");
2640
+ this.visitNode(node.filter);
2641
+ this.append(")");
2642
+ }
2643
+ if (node.over) {
2644
+ this.append(" ");
2645
+ this.visitNode(node.over);
2646
+ }
2647
+ }
2648
+ visitOver(node) {
2649
+ this.append("over(");
2650
+ if (node.partitionBy) {
2651
+ this.visitNode(node.partitionBy);
2652
+ if (node.orderBy) this.append(" ");
2653
+ }
2654
+ if (node.orderBy) this.visitNode(node.orderBy);
2655
+ this.append(")");
2656
+ }
2657
+ visitPartitionBy(node) {
2658
+ this.append("partition by ");
2659
+ this.compileList(node.items);
2660
+ }
2661
+ visitPartitionByItem(node) {
2662
+ this.visitNode(node.partitionBy);
2663
+ }
2664
+ visitBinaryOperation(node) {
2665
+ this.visitNode(node.leftOperand);
2666
+ this.append(" ");
2667
+ this.visitNode(node.operator);
2668
+ this.append(" ");
2669
+ this.visitNode(node.rightOperand);
2670
+ }
2671
+ visitUnaryOperation(node) {
2672
+ this.visitNode(node.operator);
2673
+ if (!this.isMinusOperator(node.operator)) this.append(" ");
2674
+ this.visitNode(node.operand);
2675
+ }
2676
+ isMinusOperator(node) {
2677
+ return OperatorNode.is(node) && node.operator === "-";
2678
+ }
2679
+ visitUsing(node) {
2680
+ this.append("using ");
2681
+ this.compileList(node.tables);
2682
+ }
2683
+ visitFunction(node) {
2684
+ this.append(node.func);
2685
+ this.append("(");
2686
+ this.compileList(node.arguments);
2687
+ this.append(")");
2688
+ }
2689
+ visitCase(node) {
2690
+ this.append("case");
2691
+ if (node.value) {
2692
+ this.append(" ");
2693
+ this.visitNode(node.value);
2694
+ }
2695
+ if (node.when) {
2696
+ this.append(" ");
2697
+ this.compileList(node.when, " ");
2698
+ }
2699
+ if (node.else) {
2700
+ this.append(" else ");
2701
+ this.visitNode(node.else);
2702
+ }
2703
+ this.append(" end");
2704
+ if (node.isStatement) this.append(" case");
2705
+ }
2706
+ visitWhen(node) {
2707
+ this.append("when ");
2708
+ this.visitNode(node.condition);
2709
+ if (node.result) {
2710
+ this.append(" then ");
2711
+ this.visitNode(node.result);
2712
+ }
2713
+ }
2714
+ visitJSONReference(node) {
2715
+ this.visitNode(node.reference);
2716
+ this.visitNode(node.traversal);
2717
+ }
2718
+ visitJSONPath(node) {
2719
+ if (node.inOperator) this.visitNode(node.inOperator);
2720
+ this.append("'$");
2721
+ for (const pathLeg of node.pathLegs) this.visitNode(pathLeg);
2722
+ this.append("'");
2723
+ }
2724
+ visitJSONPathLeg(node) {
2725
+ const isArrayLocation = node.type === "ArrayLocation";
2726
+ this.append(isArrayLocation ? "[" : ".");
2727
+ this.append(typeof node.value === "string" ? this.sanitizeStringLiteral(node.value) : String(node.value));
2728
+ if (isArrayLocation) this.append("]");
2729
+ }
2730
+ visitJSONOperatorChain(node) {
2731
+ for (let i = 0, len = node.values.length; i < len; i++) {
2732
+ if (i === len - 1) this.visitNode(node.operator);
2733
+ else this.append("->");
2734
+ this.visitNode(node.values[i]);
2735
+ }
2736
+ }
2737
+ visitMergeQuery(node) {
2738
+ if (node.with) {
2739
+ this.visitNode(node.with);
2740
+ this.append(" ");
2741
+ }
2742
+ this.append("merge ");
2743
+ if (node.top) {
2744
+ this.visitNode(node.top);
2745
+ this.append(" ");
2746
+ }
2747
+ this.append("into ");
2748
+ this.visitNode(node.into);
2749
+ if (node.using) {
2750
+ this.append(" ");
2751
+ this.visitNode(node.using);
2752
+ }
2753
+ if (node.whens) {
2754
+ this.append(" ");
2755
+ this.compileList(node.whens, " ");
2756
+ }
2757
+ if (node.returning) {
2758
+ this.append(" ");
2759
+ this.visitNode(node.returning);
2760
+ }
2761
+ if (node.output) {
2762
+ this.append(" ");
2763
+ this.visitNode(node.output);
2764
+ }
2765
+ if (node.endModifiers?.length) {
2766
+ this.append(" ");
2767
+ this.compileList(node.endModifiers, " ");
2768
+ }
2769
+ }
2770
+ visitMatched(node) {
2771
+ if (node.not) this.append("not ");
2772
+ this.append("matched");
2773
+ if (node.bySource) this.append(" by source");
2774
+ }
2775
+ visitAddIndex(node) {
2776
+ this.append("add ");
2777
+ if (node.unique) this.append("unique ");
2778
+ this.append("index ");
2779
+ this.visitNode(node.name);
2780
+ if (node.columns) {
2781
+ this.append(" (");
2782
+ this.compileList(node.columns);
2783
+ this.append(")");
2784
+ }
2785
+ if (node.using) {
2786
+ this.append(" using ");
2787
+ this.visitNode(node.using);
2788
+ }
2789
+ }
2790
+ visitCast(node) {
2791
+ this.append("cast(");
2792
+ this.visitNode(node.expression);
2793
+ this.append(" as ");
2794
+ this.visitNode(node.dataType);
2795
+ this.append(")");
2796
+ }
2797
+ visitFetch(node) {
2798
+ this.append("fetch next ");
2799
+ this.visitNode(node.rowCount);
2800
+ this.append(` rows ${node.modifier}`);
2801
+ }
2802
+ visitOutput(node) {
2803
+ this.append("output ");
2804
+ this.compileList(node.selections);
2805
+ }
2806
+ visitTop(node) {
2807
+ this.append(`top(${node.expression})`);
2808
+ if (node.modifiers) this.append(` ${node.modifiers}`);
2809
+ }
2810
+ visitOrAction(node) {
2811
+ this.append(node.action);
2812
+ }
2813
+ visitCollate(node) {
2814
+ this.append("collate ");
2815
+ this.visitNode(node.collation);
2816
+ }
2817
+ append(str) {
2818
+ this.#sql += str;
2819
+ }
2820
+ appendValue(parameter) {
2821
+ this.addParameter(parameter);
2822
+ this.append(this.getCurrentParameterPlaceholder());
2823
+ }
2824
+ getLeftIdentifierWrapper() {
2825
+ return "\"";
2826
+ }
2827
+ getRightIdentifierWrapper() {
2828
+ return "\"";
2829
+ }
2830
+ getCurrentParameterPlaceholder() {
2831
+ return "$" + this.numParameters;
2832
+ }
2833
+ getLeftExplainOptionsWrapper() {
2834
+ return "(";
2835
+ }
2836
+ getExplainOptionAssignment() {
2837
+ return " ";
2838
+ }
2839
+ getExplainOptionsDelimiter() {
2840
+ return ", ";
2841
+ }
2842
+ getRightExplainOptionsWrapper() {
2843
+ return ")";
2844
+ }
2845
+ sanitizeIdentifier(identifier) {
2846
+ const leftWrap = this.getLeftIdentifierWrapper();
2847
+ const rightWrap = this.getRightIdentifierWrapper();
2848
+ let sanitized = "";
2849
+ for (const c of identifier) {
2850
+ sanitized += c;
2851
+ if (c === leftWrap) sanitized += leftWrap;
2852
+ else if (c === rightWrap) sanitized += rightWrap;
2853
+ }
2854
+ return sanitized;
2855
+ }
2856
+ sanitizeStringLiteral(value) {
2857
+ return value.replace(LIT_WRAP_REGEX, "''");
2858
+ }
2859
+ addParameter(parameter) {
2860
+ this.#parameters.push(parameter);
2861
+ }
2862
+ appendImmediateValue(value) {
2863
+ if (isString(value)) this.appendStringLiteral(value);
2864
+ else if (isNumber(value) || isBoolean(value) || isBigInt(value)) this.append(value.toString());
2865
+ else if (isNull(value)) this.append("null");
2866
+ else if (isDate(value)) this.appendImmediateValue(value.toISOString());
2867
+ else throw new Error(`invalid immediate value ${value}`);
2868
+ }
2869
+ appendStringLiteral(value) {
2870
+ this.append("'");
2871
+ this.append(this.sanitizeStringLiteral(value));
2872
+ this.append("'");
2873
+ }
2874
+ sortSelectModifiers(arr) {
2875
+ arr.sort((left, right) => left.modifier && right.modifier ? SELECT_MODIFIER_PRIORITY[left.modifier] - SELECT_MODIFIER_PRIORITY[right.modifier] : 1);
2876
+ return freeze(arr);
2877
+ }
2878
+ compileColumnAlterations(columnAlterations) {
2879
+ this.compileList(columnAlterations);
2880
+ }
2881
+ /**
2882
+ * controls whether the dialect adds a "type" keyword before a column's new data
2883
+ * type in an ALTER TABLE statement.
2884
+ */
2885
+ announcesNewColumnDataType() {
2886
+ return true;
2887
+ }
2888
+ };
2889
+ var SELECT_MODIFIER_SQL = freeze({
2890
+ ForKeyShare: "for key share",
2891
+ ForNoKeyUpdate: "for no key update",
2892
+ ForUpdate: "for update",
2893
+ ForShare: "for share",
2894
+ NoWait: "nowait",
2895
+ SkipLocked: "skip locked",
2896
+ Distinct: "distinct"
2897
+ });
2898
+ var SELECT_MODIFIER_PRIORITY = freeze({
2899
+ ForKeyShare: 1,
2900
+ ForNoKeyUpdate: 1,
2901
+ ForUpdate: 1,
2902
+ ForShare: 1,
2903
+ NoWait: 2,
2904
+ SkipLocked: 2,
2905
+ Distinct: 0
2906
+ });
2907
+ var JOIN_TYPE_SQL = freeze({
2908
+ InnerJoin: "inner join",
2909
+ LeftJoin: "left join",
2910
+ RightJoin: "right join",
2911
+ FullJoin: "full join",
2912
+ CrossJoin: "cross join",
2913
+ LateralInnerJoin: "inner join lateral",
2914
+ LateralLeftJoin: "left join lateral",
2915
+ LateralCrossJoin: "cross join lateral",
2916
+ OuterApply: "outer apply",
2917
+ CrossApply: "cross apply",
2918
+ Using: "using"
2919
+ });
2920
+ //#endregion
2921
+ //#region ../../node_modules/.bun/kysely@0.28.14/node_modules/kysely/dist/esm/migration/migrator.js
2922
+ var DEFAULT_MIGRATION_TABLE = "kysely_migration";
2923
+ var DEFAULT_MIGRATION_LOCK_TABLE = "kysely_migration_lock";
2924
+ freeze({ __noMigrations__: true });
2925
+ //#endregion
2926
+ export { isBoolean as A, noop as B, SchemableIdentifierNode as C, asArray as D, IdentifierNode as E, isNumber as F, isObject as I, isReadonlyArray as L, isDate as M, isFunction as N, freeze as O, isNull as P, isString as R, AliasNode as S, ON_COMMIT_ACTIONS as T, isJSONOperator as _, SetOperationNode as a, AndNode as b, WhenNode as c, InsertQueryNode as d, ParensNode as f, OperatorNode as g, OPERATORS as h, CreateViewNode as i, isBuffer as j, isBigInt as k, UsingNode as l, RawNode as m, DEFAULT_MIGRATION_TABLE as n, WithSchemaPlugin as o, logOnce as p, DefaultQueryCompiler as r, OperationNodeTransformer as s, DEFAULT_MIGRATION_LOCK_TABLE as t, ListNode as u, JoinNode as v, CreateTableNode as w, TableNode as x, OrNode as y, isUndefined as z };