@astrojs/db 0.3.5 → 0.4.0

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 (61) hide show
  1. package/dist/core/cli/commands/link/index.js +7 -3
  2. package/dist/core/cli/commands/push/index.js +3 -3
  3. package/dist/core/cli/migration-queries.d.ts +4 -4
  4. package/dist/core/cli/migration-queries.js +73 -73
  5. package/dist/core/cli/migrations.js +15 -7
  6. package/dist/core/errors.js +7 -3
  7. package/dist/core/integration/file-url.js +2 -1
  8. package/dist/core/integration/index.js +106 -57
  9. package/dist/core/integration/typegen.d.ts +3 -3
  10. package/dist/core/integration/typegen.js +8 -8
  11. package/dist/core/integration/vite-plugin-db.d.ts +14 -9
  12. package/dist/core/integration/vite-plugin-db.js +15 -12
  13. package/dist/core/integration/vite-plugin-inject-env-ts.d.ts +4 -2
  14. package/dist/core/integration/vite-plugin-inject-env-ts.js +8 -4
  15. package/dist/core/queries.d.ts +12 -12
  16. package/dist/core/queries.js +49 -46
  17. package/dist/core/types.d.ts +232 -231
  18. package/dist/core/types.js +56 -55
  19. package/dist/core/utils.js +1 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +4 -4
  22. package/dist/runtime/db-client.d.ts +9 -4
  23. package/dist/runtime/db-client.js +11 -7
  24. package/dist/runtime/index.d.ts +7 -7
  25. package/dist/runtime/index.js +27 -29
  26. package/dist/runtime/types.d.ts +7 -7
  27. package/package.json +3 -5
  28. package/components/Renderer.astro +0 -14
  29. package/components/astro-env.d.ts +0 -1
  30. package/components/index.ts +0 -2
  31. package/components/tsconfig.json +0 -7
  32. package/dist/cli/commands/push/index.d.ts +0 -6
  33. package/dist/cli/commands/shell/index.d.ts +0 -6
  34. package/dist/cli/commands/sync/index.d.ts +0 -6
  35. package/dist/cli/commands/verify/index.d.ts +0 -6
  36. package/dist/cli/index.d.ts +0 -6
  37. package/dist/cli/queries.d.ts +0 -18
  38. package/dist/cli/seed.d.ts +0 -6
  39. package/dist/cli/sync/admin.d.ts +0 -33
  40. package/dist/cli/sync/index.d.ts +0 -1
  41. package/dist/cli/sync/migrate.d.ts +0 -1
  42. package/dist/cli/sync/queries.d.ts +0 -19
  43. package/dist/cli/sync/remote-db.d.ts +0 -1
  44. package/dist/config.d.ts +0 -1374
  45. package/dist/consts.d.ts +0 -7
  46. package/dist/core/cli/commands/sync/index.d.ts +0 -6
  47. package/dist/error-map.d.ts +0 -6
  48. package/dist/errors.d.ts +0 -3
  49. package/dist/file-url-integration.d.ts +0 -2
  50. package/dist/integration.d.ts +0 -2
  51. package/dist/internal-drizzle.d.ts +0 -1
  52. package/dist/internal.d.ts +0 -47
  53. package/dist/load-astro-config.d.ts +0 -6
  54. package/dist/migrations.d.ts +0 -12
  55. package/dist/root.d.ts +0 -3
  56. package/dist/typegen.d.ts +0 -5
  57. package/dist/types.d.ts +0 -1604
  58. package/dist/utils-runtime.d.ts +0 -1
  59. package/dist/utils.d.ts +0 -59
  60. package/dist/vite-plugin-db.d.ts +0 -19
  61. package/dist/vite-plugin-inject-env-ts.d.ts +0 -9
package/dist/types.d.ts DELETED
@@ -1,1604 +0,0 @@
1
- import type { ColumnDataType, ColumnBaseConfig } from 'drizzle-orm';
2
- import type { SQLiteColumn, SQLiteTableWithColumns } from 'drizzle-orm/sqlite-core';
3
- import { z } from 'zod';
4
- declare const booleanColumnSchema: z.ZodObject<{
5
- label: z.ZodOptional<z.ZodString>;
6
- optional: z.ZodOptional<z.ZodBoolean>;
7
- unique: z.ZodOptional<z.ZodBoolean>;
8
- type: z.ZodLiteral<"boolean">;
9
- default: z.ZodOptional<z.ZodBoolean>;
10
- }, "strip", z.ZodTypeAny, {
11
- type: "boolean";
12
- label?: string | undefined;
13
- optional?: boolean | undefined;
14
- unique?: boolean | undefined;
15
- default?: boolean | undefined;
16
- }, {
17
- type: "boolean";
18
- label?: string | undefined;
19
- optional?: boolean | undefined;
20
- unique?: boolean | undefined;
21
- default?: boolean | undefined;
22
- }>;
23
- declare const numberColumnSchema: z.ZodObject<{
24
- label: z.ZodOptional<z.ZodString>;
25
- optional: z.ZodOptional<z.ZodBoolean>;
26
- unique: z.ZodOptional<z.ZodBoolean>;
27
- type: z.ZodLiteral<"number">;
28
- default: z.ZodOptional<z.ZodNumber>;
29
- primaryKey: z.ZodOptional<z.ZodBoolean>;
30
- }, "strip", z.ZodTypeAny, {
31
- type: "number";
32
- label?: string | undefined;
33
- optional?: boolean | undefined;
34
- unique?: boolean | undefined;
35
- default?: number | undefined;
36
- primaryKey?: boolean | undefined;
37
- }, {
38
- type: "number";
39
- label?: string | undefined;
40
- optional?: boolean | undefined;
41
- unique?: boolean | undefined;
42
- default?: number | undefined;
43
- primaryKey?: boolean | undefined;
44
- }>;
45
- declare const textColumnSchema: z.ZodObject<{
46
- label: z.ZodOptional<z.ZodString>;
47
- optional: z.ZodOptional<z.ZodBoolean>;
48
- unique: z.ZodOptional<z.ZodBoolean>;
49
- type: z.ZodLiteral<"text">;
50
- multiline: z.ZodOptional<z.ZodBoolean>;
51
- default: z.ZodOptional<z.ZodString>;
52
- primaryKey: z.ZodOptional<z.ZodBoolean>;
53
- }, "strip", z.ZodTypeAny, {
54
- type: "text";
55
- label?: string | undefined;
56
- optional?: boolean | undefined;
57
- unique?: boolean | undefined;
58
- multiline?: boolean | undefined;
59
- default?: string | undefined;
60
- primaryKey?: boolean | undefined;
61
- }, {
62
- type: "text";
63
- label?: string | undefined;
64
- optional?: boolean | undefined;
65
- unique?: boolean | undefined;
66
- multiline?: boolean | undefined;
67
- default?: string | undefined;
68
- primaryKey?: boolean | undefined;
69
- }>;
70
- declare const dateColumnSchema: z.ZodObject<{
71
- label: z.ZodOptional<z.ZodString>;
72
- optional: z.ZodOptional<z.ZodBoolean>;
73
- unique: z.ZodOptional<z.ZodBoolean>;
74
- type: z.ZodLiteral<"date">;
75
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
76
- }, "strip", z.ZodTypeAny, {
77
- type: "date";
78
- label?: string | undefined;
79
- optional?: boolean | undefined;
80
- unique?: boolean | undefined;
81
- default?: string | undefined;
82
- }, {
83
- type: "date";
84
- label?: string | undefined;
85
- optional?: boolean | undefined;
86
- unique?: boolean | undefined;
87
- default?: Date | "now" | undefined;
88
- }>;
89
- declare const jsonColumnSchema: z.ZodObject<{
90
- label: z.ZodOptional<z.ZodString>;
91
- optional: z.ZodOptional<z.ZodBoolean>;
92
- unique: z.ZodOptional<z.ZodBoolean>;
93
- type: z.ZodLiteral<"json">;
94
- default: z.ZodOptional<z.ZodUnknown>;
95
- }, "strip", z.ZodTypeAny, {
96
- type: "json";
97
- label?: string | undefined;
98
- optional?: boolean | undefined;
99
- unique?: boolean | undefined;
100
- default?: unknown;
101
- }, {
102
- type: "json";
103
- label?: string | undefined;
104
- optional?: boolean | undefined;
105
- unique?: boolean | undefined;
106
- default?: unknown;
107
- }>;
108
- declare const columnSchema: z.ZodUnion<[z.ZodObject<{
109
- label: z.ZodOptional<z.ZodString>;
110
- optional: z.ZodOptional<z.ZodBoolean>;
111
- unique: z.ZodOptional<z.ZodBoolean>;
112
- type: z.ZodLiteral<"boolean">;
113
- default: z.ZodOptional<z.ZodBoolean>;
114
- }, "strip", z.ZodTypeAny, {
115
- type: "boolean";
116
- label?: string | undefined;
117
- optional?: boolean | undefined;
118
- unique?: boolean | undefined;
119
- default?: boolean | undefined;
120
- }, {
121
- type: "boolean";
122
- label?: string | undefined;
123
- optional?: boolean | undefined;
124
- unique?: boolean | undefined;
125
- default?: boolean | undefined;
126
- }>, z.ZodObject<{
127
- label: z.ZodOptional<z.ZodString>;
128
- optional: z.ZodOptional<z.ZodBoolean>;
129
- unique: z.ZodOptional<z.ZodBoolean>;
130
- type: z.ZodLiteral<"number">;
131
- default: z.ZodOptional<z.ZodNumber>;
132
- primaryKey: z.ZodOptional<z.ZodBoolean>;
133
- }, "strip", z.ZodTypeAny, {
134
- type: "number";
135
- label?: string | undefined;
136
- optional?: boolean | undefined;
137
- unique?: boolean | undefined;
138
- default?: number | undefined;
139
- primaryKey?: boolean | undefined;
140
- }, {
141
- type: "number";
142
- label?: string | undefined;
143
- optional?: boolean | undefined;
144
- unique?: boolean | undefined;
145
- default?: number | undefined;
146
- primaryKey?: boolean | undefined;
147
- }>, z.ZodObject<{
148
- label: z.ZodOptional<z.ZodString>;
149
- optional: z.ZodOptional<z.ZodBoolean>;
150
- unique: z.ZodOptional<z.ZodBoolean>;
151
- type: z.ZodLiteral<"text">;
152
- multiline: z.ZodOptional<z.ZodBoolean>;
153
- default: z.ZodOptional<z.ZodString>;
154
- primaryKey: z.ZodOptional<z.ZodBoolean>;
155
- }, "strip", z.ZodTypeAny, {
156
- type: "text";
157
- label?: string | undefined;
158
- optional?: boolean | undefined;
159
- unique?: boolean | undefined;
160
- multiline?: boolean | undefined;
161
- default?: string | undefined;
162
- primaryKey?: boolean | undefined;
163
- }, {
164
- type: "text";
165
- label?: string | undefined;
166
- optional?: boolean | undefined;
167
- unique?: boolean | undefined;
168
- multiline?: boolean | undefined;
169
- default?: string | undefined;
170
- primaryKey?: boolean | undefined;
171
- }>, z.ZodObject<{
172
- label: z.ZodOptional<z.ZodString>;
173
- optional: z.ZodOptional<z.ZodBoolean>;
174
- unique: z.ZodOptional<z.ZodBoolean>;
175
- type: z.ZodLiteral<"date">;
176
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
177
- }, "strip", z.ZodTypeAny, {
178
- type: "date";
179
- label?: string | undefined;
180
- optional?: boolean | undefined;
181
- unique?: boolean | undefined;
182
- default?: string | undefined;
183
- }, {
184
- type: "date";
185
- label?: string | undefined;
186
- optional?: boolean | undefined;
187
- unique?: boolean | undefined;
188
- default?: Date | "now" | undefined;
189
- }>, z.ZodObject<{
190
- label: z.ZodOptional<z.ZodString>;
191
- optional: z.ZodOptional<z.ZodBoolean>;
192
- unique: z.ZodOptional<z.ZodBoolean>;
193
- type: z.ZodLiteral<"json">;
194
- default: z.ZodOptional<z.ZodUnknown>;
195
- }, "strip", z.ZodTypeAny, {
196
- type: "json";
197
- label?: string | undefined;
198
- optional?: boolean | undefined;
199
- unique?: boolean | undefined;
200
- default?: unknown;
201
- }, {
202
- type: "json";
203
- label?: string | undefined;
204
- optional?: boolean | undefined;
205
- unique?: boolean | undefined;
206
- default?: unknown;
207
- }>]>;
208
- declare const columnsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
209
- label: z.ZodOptional<z.ZodString>;
210
- optional: z.ZodOptional<z.ZodBoolean>;
211
- unique: z.ZodOptional<z.ZodBoolean>;
212
- type: z.ZodLiteral<"boolean">;
213
- default: z.ZodOptional<z.ZodBoolean>;
214
- }, "strip", z.ZodTypeAny, {
215
- type: "boolean";
216
- label?: string | undefined;
217
- optional?: boolean | undefined;
218
- unique?: boolean | undefined;
219
- default?: boolean | undefined;
220
- }, {
221
- type: "boolean";
222
- label?: string | undefined;
223
- optional?: boolean | undefined;
224
- unique?: boolean | undefined;
225
- default?: boolean | undefined;
226
- }>, z.ZodObject<{
227
- label: z.ZodOptional<z.ZodString>;
228
- optional: z.ZodOptional<z.ZodBoolean>;
229
- unique: z.ZodOptional<z.ZodBoolean>;
230
- type: z.ZodLiteral<"number">;
231
- default: z.ZodOptional<z.ZodNumber>;
232
- primaryKey: z.ZodOptional<z.ZodBoolean>;
233
- }, "strip", z.ZodTypeAny, {
234
- type: "number";
235
- label?: string | undefined;
236
- optional?: boolean | undefined;
237
- unique?: boolean | undefined;
238
- default?: number | undefined;
239
- primaryKey?: boolean | undefined;
240
- }, {
241
- type: "number";
242
- label?: string | undefined;
243
- optional?: boolean | undefined;
244
- unique?: boolean | undefined;
245
- default?: number | undefined;
246
- primaryKey?: boolean | undefined;
247
- }>, z.ZodObject<{
248
- label: z.ZodOptional<z.ZodString>;
249
- optional: z.ZodOptional<z.ZodBoolean>;
250
- unique: z.ZodOptional<z.ZodBoolean>;
251
- type: z.ZodLiteral<"text">;
252
- multiline: z.ZodOptional<z.ZodBoolean>;
253
- default: z.ZodOptional<z.ZodString>;
254
- primaryKey: z.ZodOptional<z.ZodBoolean>;
255
- }, "strip", z.ZodTypeAny, {
256
- type: "text";
257
- label?: string | undefined;
258
- optional?: boolean | undefined;
259
- unique?: boolean | undefined;
260
- multiline?: boolean | undefined;
261
- default?: string | undefined;
262
- primaryKey?: boolean | undefined;
263
- }, {
264
- type: "text";
265
- label?: string | undefined;
266
- optional?: boolean | undefined;
267
- unique?: boolean | undefined;
268
- multiline?: boolean | undefined;
269
- default?: string | undefined;
270
- primaryKey?: boolean | undefined;
271
- }>, z.ZodObject<{
272
- label: z.ZodOptional<z.ZodString>;
273
- optional: z.ZodOptional<z.ZodBoolean>;
274
- unique: z.ZodOptional<z.ZodBoolean>;
275
- type: z.ZodLiteral<"date">;
276
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
277
- }, "strip", z.ZodTypeAny, {
278
- type: "date";
279
- label?: string | undefined;
280
- optional?: boolean | undefined;
281
- unique?: boolean | undefined;
282
- default?: string | undefined;
283
- }, {
284
- type: "date";
285
- label?: string | undefined;
286
- optional?: boolean | undefined;
287
- unique?: boolean | undefined;
288
- default?: Date | "now" | undefined;
289
- }>, z.ZodObject<{
290
- label: z.ZodOptional<z.ZodString>;
291
- optional: z.ZodOptional<z.ZodBoolean>;
292
- unique: z.ZodOptional<z.ZodBoolean>;
293
- type: z.ZodLiteral<"json">;
294
- default: z.ZodOptional<z.ZodUnknown>;
295
- }, "strip", z.ZodTypeAny, {
296
- type: "json";
297
- label?: string | undefined;
298
- optional?: boolean | undefined;
299
- unique?: boolean | undefined;
300
- default?: unknown;
301
- }, {
302
- type: "json";
303
- label?: string | undefined;
304
- optional?: boolean | undefined;
305
- unique?: boolean | undefined;
306
- default?: unknown;
307
- }>]>>;
308
- export declare const indexSchema: z.ZodObject<{
309
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
310
- unique: z.ZodOptional<z.ZodBoolean>;
311
- }, "strip", z.ZodTypeAny, {
312
- on: (string | string[]) & (string | string[] | undefined);
313
- unique?: boolean | undefined;
314
- }, {
315
- on: (string | string[]) & (string | string[] | undefined);
316
- unique?: boolean | undefined;
317
- }>;
318
- export declare const readableCollectionSchema: z.ZodObject<{
319
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
320
- label: z.ZodOptional<z.ZodString>;
321
- optional: z.ZodOptional<z.ZodBoolean>;
322
- unique: z.ZodOptional<z.ZodBoolean>;
323
- type: z.ZodLiteral<"boolean">;
324
- default: z.ZodOptional<z.ZodBoolean>;
325
- }, "strip", z.ZodTypeAny, {
326
- type: "boolean";
327
- label?: string | undefined;
328
- optional?: boolean | undefined;
329
- unique?: boolean | undefined;
330
- default?: boolean | undefined;
331
- }, {
332
- type: "boolean";
333
- label?: string | undefined;
334
- optional?: boolean | undefined;
335
- unique?: boolean | undefined;
336
- default?: boolean | undefined;
337
- }>, z.ZodObject<{
338
- label: z.ZodOptional<z.ZodString>;
339
- optional: z.ZodOptional<z.ZodBoolean>;
340
- unique: z.ZodOptional<z.ZodBoolean>;
341
- type: z.ZodLiteral<"number">;
342
- default: z.ZodOptional<z.ZodNumber>;
343
- primaryKey: z.ZodOptional<z.ZodBoolean>;
344
- }, "strip", z.ZodTypeAny, {
345
- type: "number";
346
- label?: string | undefined;
347
- optional?: boolean | undefined;
348
- unique?: boolean | undefined;
349
- default?: number | undefined;
350
- primaryKey?: boolean | undefined;
351
- }, {
352
- type: "number";
353
- label?: string | undefined;
354
- optional?: boolean | undefined;
355
- unique?: boolean | undefined;
356
- default?: number | undefined;
357
- primaryKey?: boolean | undefined;
358
- }>, z.ZodObject<{
359
- label: z.ZodOptional<z.ZodString>;
360
- optional: z.ZodOptional<z.ZodBoolean>;
361
- unique: z.ZodOptional<z.ZodBoolean>;
362
- type: z.ZodLiteral<"text">;
363
- multiline: z.ZodOptional<z.ZodBoolean>;
364
- default: z.ZodOptional<z.ZodString>;
365
- primaryKey: z.ZodOptional<z.ZodBoolean>;
366
- }, "strip", z.ZodTypeAny, {
367
- type: "text";
368
- label?: string | undefined;
369
- optional?: boolean | undefined;
370
- unique?: boolean | undefined;
371
- multiline?: boolean | undefined;
372
- default?: string | undefined;
373
- primaryKey?: boolean | undefined;
374
- }, {
375
- type: "text";
376
- label?: string | undefined;
377
- optional?: boolean | undefined;
378
- unique?: boolean | undefined;
379
- multiline?: boolean | undefined;
380
- default?: string | undefined;
381
- primaryKey?: boolean | undefined;
382
- }>, z.ZodObject<{
383
- label: z.ZodOptional<z.ZodString>;
384
- optional: z.ZodOptional<z.ZodBoolean>;
385
- unique: z.ZodOptional<z.ZodBoolean>;
386
- type: z.ZodLiteral<"date">;
387
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
388
- }, "strip", z.ZodTypeAny, {
389
- type: "date";
390
- label?: string | undefined;
391
- optional?: boolean | undefined;
392
- unique?: boolean | undefined;
393
- default?: string | undefined;
394
- }, {
395
- type: "date";
396
- label?: string | undefined;
397
- optional?: boolean | undefined;
398
- unique?: boolean | undefined;
399
- default?: Date | "now" | undefined;
400
- }>, z.ZodObject<{
401
- label: z.ZodOptional<z.ZodString>;
402
- optional: z.ZodOptional<z.ZodBoolean>;
403
- unique: z.ZodOptional<z.ZodBoolean>;
404
- type: z.ZodLiteral<"json">;
405
- default: z.ZodOptional<z.ZodUnknown>;
406
- }, "strip", z.ZodTypeAny, {
407
- type: "json";
408
- label?: string | undefined;
409
- optional?: boolean | undefined;
410
- unique?: boolean | undefined;
411
- default?: unknown;
412
- }, {
413
- type: "json";
414
- label?: string | undefined;
415
- optional?: boolean | undefined;
416
- unique?: boolean | undefined;
417
- default?: unknown;
418
- }>]>>;
419
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
420
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
421
- unique: z.ZodOptional<z.ZodBoolean>;
422
- }, "strip", z.ZodTypeAny, {
423
- on: (string | string[]) & (string | string[] | undefined);
424
- unique?: boolean | undefined;
425
- }, {
426
- on: (string | string[]) & (string | string[] | undefined);
427
- unique?: boolean | undefined;
428
- }>>>;
429
- table: z.ZodAny;
430
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
431
- writable: z.ZodLiteral<false>;
432
- }, "strip", z.ZodTypeAny, {
433
- columns: Record<string, {
434
- type: "boolean";
435
- label?: string | undefined;
436
- optional?: boolean | undefined;
437
- unique?: boolean | undefined;
438
- default?: boolean | undefined;
439
- } | {
440
- type: "number";
441
- label?: string | undefined;
442
- optional?: boolean | undefined;
443
- unique?: boolean | undefined;
444
- default?: number | undefined;
445
- primaryKey?: boolean | undefined;
446
- } | {
447
- type: "text";
448
- label?: string | undefined;
449
- optional?: boolean | undefined;
450
- unique?: boolean | undefined;
451
- multiline?: boolean | undefined;
452
- default?: string | undefined;
453
- primaryKey?: boolean | undefined;
454
- } | {
455
- type: "date";
456
- label?: string | undefined;
457
- optional?: boolean | undefined;
458
- unique?: boolean | undefined;
459
- default?: string | undefined;
460
- } | {
461
- type: "json";
462
- label?: string | undefined;
463
- optional?: boolean | undefined;
464
- unique?: boolean | undefined;
465
- default?: unknown;
466
- }>;
467
- writable: false;
468
- indexes?: Record<string, {
469
- on: (string | string[]) & (string | string[] | undefined);
470
- unique?: boolean | undefined;
471
- }> | undefined;
472
- table?: any;
473
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
474
- }, {
475
- columns: Record<string, {
476
- type: "boolean";
477
- label?: string | undefined;
478
- optional?: boolean | undefined;
479
- unique?: boolean | undefined;
480
- default?: boolean | undefined;
481
- } | {
482
- type: "number";
483
- label?: string | undefined;
484
- optional?: boolean | undefined;
485
- unique?: boolean | undefined;
486
- default?: number | undefined;
487
- primaryKey?: boolean | undefined;
488
- } | {
489
- type: "text";
490
- label?: string | undefined;
491
- optional?: boolean | undefined;
492
- unique?: boolean | undefined;
493
- multiline?: boolean | undefined;
494
- default?: string | undefined;
495
- primaryKey?: boolean | undefined;
496
- } | {
497
- type: "date";
498
- label?: string | undefined;
499
- optional?: boolean | undefined;
500
- unique?: boolean | undefined;
501
- default?: Date | "now" | undefined;
502
- } | {
503
- type: "json";
504
- label?: string | undefined;
505
- optional?: boolean | undefined;
506
- unique?: boolean | undefined;
507
- default?: unknown;
508
- }>;
509
- writable: false;
510
- indexes?: Record<string, {
511
- on: (string | string[]) & (string | string[] | undefined);
512
- unique?: boolean | undefined;
513
- }> | undefined;
514
- table?: any;
515
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
516
- }>;
517
- export declare const writableCollectionSchema: z.ZodObject<{
518
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
519
- label: z.ZodOptional<z.ZodString>;
520
- optional: z.ZodOptional<z.ZodBoolean>;
521
- unique: z.ZodOptional<z.ZodBoolean>;
522
- type: z.ZodLiteral<"boolean">;
523
- default: z.ZodOptional<z.ZodBoolean>;
524
- }, "strip", z.ZodTypeAny, {
525
- type: "boolean";
526
- label?: string | undefined;
527
- optional?: boolean | undefined;
528
- unique?: boolean | undefined;
529
- default?: boolean | undefined;
530
- }, {
531
- type: "boolean";
532
- label?: string | undefined;
533
- optional?: boolean | undefined;
534
- unique?: boolean | undefined;
535
- default?: boolean | undefined;
536
- }>, z.ZodObject<{
537
- label: z.ZodOptional<z.ZodString>;
538
- optional: z.ZodOptional<z.ZodBoolean>;
539
- unique: z.ZodOptional<z.ZodBoolean>;
540
- type: z.ZodLiteral<"number">;
541
- default: z.ZodOptional<z.ZodNumber>;
542
- primaryKey: z.ZodOptional<z.ZodBoolean>;
543
- }, "strip", z.ZodTypeAny, {
544
- type: "number";
545
- label?: string | undefined;
546
- optional?: boolean | undefined;
547
- unique?: boolean | undefined;
548
- default?: number | undefined;
549
- primaryKey?: boolean | undefined;
550
- }, {
551
- type: "number";
552
- label?: string | undefined;
553
- optional?: boolean | undefined;
554
- unique?: boolean | undefined;
555
- default?: number | undefined;
556
- primaryKey?: boolean | undefined;
557
- }>, z.ZodObject<{
558
- label: z.ZodOptional<z.ZodString>;
559
- optional: z.ZodOptional<z.ZodBoolean>;
560
- unique: z.ZodOptional<z.ZodBoolean>;
561
- type: z.ZodLiteral<"text">;
562
- multiline: z.ZodOptional<z.ZodBoolean>;
563
- default: z.ZodOptional<z.ZodString>;
564
- primaryKey: z.ZodOptional<z.ZodBoolean>;
565
- }, "strip", z.ZodTypeAny, {
566
- type: "text";
567
- label?: string | undefined;
568
- optional?: boolean | undefined;
569
- unique?: boolean | undefined;
570
- multiline?: boolean | undefined;
571
- default?: string | undefined;
572
- primaryKey?: boolean | undefined;
573
- }, {
574
- type: "text";
575
- label?: string | undefined;
576
- optional?: boolean | undefined;
577
- unique?: boolean | undefined;
578
- multiline?: boolean | undefined;
579
- default?: string | undefined;
580
- primaryKey?: boolean | undefined;
581
- }>, z.ZodObject<{
582
- label: z.ZodOptional<z.ZodString>;
583
- optional: z.ZodOptional<z.ZodBoolean>;
584
- unique: z.ZodOptional<z.ZodBoolean>;
585
- type: z.ZodLiteral<"date">;
586
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
587
- }, "strip", z.ZodTypeAny, {
588
- type: "date";
589
- label?: string | undefined;
590
- optional?: boolean | undefined;
591
- unique?: boolean | undefined;
592
- default?: string | undefined;
593
- }, {
594
- type: "date";
595
- label?: string | undefined;
596
- optional?: boolean | undefined;
597
- unique?: boolean | undefined;
598
- default?: Date | "now" | undefined;
599
- }>, z.ZodObject<{
600
- label: z.ZodOptional<z.ZodString>;
601
- optional: z.ZodOptional<z.ZodBoolean>;
602
- unique: z.ZodOptional<z.ZodBoolean>;
603
- type: z.ZodLiteral<"json">;
604
- default: z.ZodOptional<z.ZodUnknown>;
605
- }, "strip", z.ZodTypeAny, {
606
- type: "json";
607
- label?: string | undefined;
608
- optional?: boolean | undefined;
609
- unique?: boolean | undefined;
610
- default?: unknown;
611
- }, {
612
- type: "json";
613
- label?: string | undefined;
614
- optional?: boolean | undefined;
615
- unique?: boolean | undefined;
616
- default?: unknown;
617
- }>]>>;
618
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
619
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
620
- unique: z.ZodOptional<z.ZodBoolean>;
621
- }, "strip", z.ZodTypeAny, {
622
- on: (string | string[]) & (string | string[] | undefined);
623
- unique?: boolean | undefined;
624
- }, {
625
- on: (string | string[]) & (string | string[] | undefined);
626
- unique?: boolean | undefined;
627
- }>>>;
628
- table: z.ZodAny;
629
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
630
- writable: z.ZodLiteral<true>;
631
- }, "strip", z.ZodTypeAny, {
632
- columns: Record<string, {
633
- type: "boolean";
634
- label?: string | undefined;
635
- optional?: boolean | undefined;
636
- unique?: boolean | undefined;
637
- default?: boolean | undefined;
638
- } | {
639
- type: "number";
640
- label?: string | undefined;
641
- optional?: boolean | undefined;
642
- unique?: boolean | undefined;
643
- default?: number | undefined;
644
- primaryKey?: boolean | undefined;
645
- } | {
646
- type: "text";
647
- label?: string | undefined;
648
- optional?: boolean | undefined;
649
- unique?: boolean | undefined;
650
- multiline?: boolean | undefined;
651
- default?: string | undefined;
652
- primaryKey?: boolean | undefined;
653
- } | {
654
- type: "date";
655
- label?: string | undefined;
656
- optional?: boolean | undefined;
657
- unique?: boolean | undefined;
658
- default?: string | undefined;
659
- } | {
660
- type: "json";
661
- label?: string | undefined;
662
- optional?: boolean | undefined;
663
- unique?: boolean | undefined;
664
- default?: unknown;
665
- }>;
666
- writable: true;
667
- indexes?: Record<string, {
668
- on: (string | string[]) & (string | string[] | undefined);
669
- unique?: boolean | undefined;
670
- }> | undefined;
671
- table?: any;
672
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
673
- }, {
674
- columns: Record<string, {
675
- type: "boolean";
676
- label?: string | undefined;
677
- optional?: boolean | undefined;
678
- unique?: boolean | undefined;
679
- default?: boolean | undefined;
680
- } | {
681
- type: "number";
682
- label?: string | undefined;
683
- optional?: boolean | undefined;
684
- unique?: boolean | undefined;
685
- default?: number | undefined;
686
- primaryKey?: boolean | undefined;
687
- } | {
688
- type: "text";
689
- label?: string | undefined;
690
- optional?: boolean | undefined;
691
- unique?: boolean | undefined;
692
- multiline?: boolean | undefined;
693
- default?: string | undefined;
694
- primaryKey?: boolean | undefined;
695
- } | {
696
- type: "date";
697
- label?: string | undefined;
698
- optional?: boolean | undefined;
699
- unique?: boolean | undefined;
700
- default?: Date | "now" | undefined;
701
- } | {
702
- type: "json";
703
- label?: string | undefined;
704
- optional?: boolean | undefined;
705
- unique?: boolean | undefined;
706
- default?: unknown;
707
- }>;
708
- writable: true;
709
- indexes?: Record<string, {
710
- on: (string | string[]) & (string | string[] | undefined);
711
- unique?: boolean | undefined;
712
- }> | undefined;
713
- table?: any;
714
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
715
- }>;
716
- export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
717
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
718
- label: z.ZodOptional<z.ZodString>;
719
- optional: z.ZodOptional<z.ZodBoolean>;
720
- unique: z.ZodOptional<z.ZodBoolean>;
721
- type: z.ZodLiteral<"boolean">;
722
- default: z.ZodOptional<z.ZodBoolean>;
723
- }, "strip", z.ZodTypeAny, {
724
- type: "boolean";
725
- label?: string | undefined;
726
- optional?: boolean | undefined;
727
- unique?: boolean | undefined;
728
- default?: boolean | undefined;
729
- }, {
730
- type: "boolean";
731
- label?: string | undefined;
732
- optional?: boolean | undefined;
733
- unique?: boolean | undefined;
734
- default?: boolean | undefined;
735
- }>, z.ZodObject<{
736
- label: z.ZodOptional<z.ZodString>;
737
- optional: z.ZodOptional<z.ZodBoolean>;
738
- unique: z.ZodOptional<z.ZodBoolean>;
739
- type: z.ZodLiteral<"number">;
740
- default: z.ZodOptional<z.ZodNumber>;
741
- primaryKey: z.ZodOptional<z.ZodBoolean>;
742
- }, "strip", z.ZodTypeAny, {
743
- type: "number";
744
- label?: string | undefined;
745
- optional?: boolean | undefined;
746
- unique?: boolean | undefined;
747
- default?: number | undefined;
748
- primaryKey?: boolean | undefined;
749
- }, {
750
- type: "number";
751
- label?: string | undefined;
752
- optional?: boolean | undefined;
753
- unique?: boolean | undefined;
754
- default?: number | undefined;
755
- primaryKey?: boolean | undefined;
756
- }>, z.ZodObject<{
757
- label: z.ZodOptional<z.ZodString>;
758
- optional: z.ZodOptional<z.ZodBoolean>;
759
- unique: z.ZodOptional<z.ZodBoolean>;
760
- type: z.ZodLiteral<"text">;
761
- multiline: z.ZodOptional<z.ZodBoolean>;
762
- default: z.ZodOptional<z.ZodString>;
763
- primaryKey: z.ZodOptional<z.ZodBoolean>;
764
- }, "strip", z.ZodTypeAny, {
765
- type: "text";
766
- label?: string | undefined;
767
- optional?: boolean | undefined;
768
- unique?: boolean | undefined;
769
- multiline?: boolean | undefined;
770
- default?: string | undefined;
771
- primaryKey?: boolean | undefined;
772
- }, {
773
- type: "text";
774
- label?: string | undefined;
775
- optional?: boolean | undefined;
776
- unique?: boolean | undefined;
777
- multiline?: boolean | undefined;
778
- default?: string | undefined;
779
- primaryKey?: boolean | undefined;
780
- }>, z.ZodObject<{
781
- label: z.ZodOptional<z.ZodString>;
782
- optional: z.ZodOptional<z.ZodBoolean>;
783
- unique: z.ZodOptional<z.ZodBoolean>;
784
- type: z.ZodLiteral<"date">;
785
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
786
- }, "strip", z.ZodTypeAny, {
787
- type: "date";
788
- label?: string | undefined;
789
- optional?: boolean | undefined;
790
- unique?: boolean | undefined;
791
- default?: string | undefined;
792
- }, {
793
- type: "date";
794
- label?: string | undefined;
795
- optional?: boolean | undefined;
796
- unique?: boolean | undefined;
797
- default?: Date | "now" | undefined;
798
- }>, z.ZodObject<{
799
- label: z.ZodOptional<z.ZodString>;
800
- optional: z.ZodOptional<z.ZodBoolean>;
801
- unique: z.ZodOptional<z.ZodBoolean>;
802
- type: z.ZodLiteral<"json">;
803
- default: z.ZodOptional<z.ZodUnknown>;
804
- }, "strip", z.ZodTypeAny, {
805
- type: "json";
806
- label?: string | undefined;
807
- optional?: boolean | undefined;
808
- unique?: boolean | undefined;
809
- default?: unknown;
810
- }, {
811
- type: "json";
812
- label?: string | undefined;
813
- optional?: boolean | undefined;
814
- unique?: boolean | undefined;
815
- default?: unknown;
816
- }>]>>;
817
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
818
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
819
- unique: z.ZodOptional<z.ZodBoolean>;
820
- }, "strip", z.ZodTypeAny, {
821
- on: (string | string[]) & (string | string[] | undefined);
822
- unique?: boolean | undefined;
823
- }, {
824
- on: (string | string[]) & (string | string[] | undefined);
825
- unique?: boolean | undefined;
826
- }>>>;
827
- table: z.ZodAny;
828
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
829
- writable: z.ZodLiteral<false>;
830
- }, "strip", z.ZodTypeAny, {
831
- columns: Record<string, {
832
- type: "boolean";
833
- label?: string | undefined;
834
- optional?: boolean | undefined;
835
- unique?: boolean | undefined;
836
- default?: boolean | undefined;
837
- } | {
838
- type: "number";
839
- label?: string | undefined;
840
- optional?: boolean | undefined;
841
- unique?: boolean | undefined;
842
- default?: number | undefined;
843
- primaryKey?: boolean | undefined;
844
- } | {
845
- type: "text";
846
- label?: string | undefined;
847
- optional?: boolean | undefined;
848
- unique?: boolean | undefined;
849
- multiline?: boolean | undefined;
850
- default?: string | undefined;
851
- primaryKey?: boolean | undefined;
852
- } | {
853
- type: "date";
854
- label?: string | undefined;
855
- optional?: boolean | undefined;
856
- unique?: boolean | undefined;
857
- default?: string | undefined;
858
- } | {
859
- type: "json";
860
- label?: string | undefined;
861
- optional?: boolean | undefined;
862
- unique?: boolean | undefined;
863
- default?: unknown;
864
- }>;
865
- writable: false;
866
- indexes?: Record<string, {
867
- on: (string | string[]) & (string | string[] | undefined);
868
- unique?: boolean | undefined;
869
- }> | undefined;
870
- table?: any;
871
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
872
- }, {
873
- columns: Record<string, {
874
- type: "boolean";
875
- label?: string | undefined;
876
- optional?: boolean | undefined;
877
- unique?: boolean | undefined;
878
- default?: boolean | undefined;
879
- } | {
880
- type: "number";
881
- label?: string | undefined;
882
- optional?: boolean | undefined;
883
- unique?: boolean | undefined;
884
- default?: number | undefined;
885
- primaryKey?: boolean | undefined;
886
- } | {
887
- type: "text";
888
- label?: string | undefined;
889
- optional?: boolean | undefined;
890
- unique?: boolean | undefined;
891
- multiline?: boolean | undefined;
892
- default?: string | undefined;
893
- primaryKey?: boolean | undefined;
894
- } | {
895
- type: "date";
896
- label?: string | undefined;
897
- optional?: boolean | undefined;
898
- unique?: boolean | undefined;
899
- default?: Date | "now" | undefined;
900
- } | {
901
- type: "json";
902
- label?: string | undefined;
903
- optional?: boolean | undefined;
904
- unique?: boolean | undefined;
905
- default?: unknown;
906
- }>;
907
- writable: false;
908
- indexes?: Record<string, {
909
- on: (string | string[]) & (string | string[] | undefined);
910
- unique?: boolean | undefined;
911
- }> | undefined;
912
- table?: any;
913
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
914
- }>, z.ZodObject<{
915
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
916
- label: z.ZodOptional<z.ZodString>;
917
- optional: z.ZodOptional<z.ZodBoolean>;
918
- unique: z.ZodOptional<z.ZodBoolean>;
919
- type: z.ZodLiteral<"boolean">;
920
- default: z.ZodOptional<z.ZodBoolean>;
921
- }, "strip", z.ZodTypeAny, {
922
- type: "boolean";
923
- label?: string | undefined;
924
- optional?: boolean | undefined;
925
- unique?: boolean | undefined;
926
- default?: boolean | undefined;
927
- }, {
928
- type: "boolean";
929
- label?: string | undefined;
930
- optional?: boolean | undefined;
931
- unique?: boolean | undefined;
932
- default?: boolean | undefined;
933
- }>, z.ZodObject<{
934
- label: z.ZodOptional<z.ZodString>;
935
- optional: z.ZodOptional<z.ZodBoolean>;
936
- unique: z.ZodOptional<z.ZodBoolean>;
937
- type: z.ZodLiteral<"number">;
938
- default: z.ZodOptional<z.ZodNumber>;
939
- primaryKey: z.ZodOptional<z.ZodBoolean>;
940
- }, "strip", z.ZodTypeAny, {
941
- type: "number";
942
- label?: string | undefined;
943
- optional?: boolean | undefined;
944
- unique?: boolean | undefined;
945
- default?: number | undefined;
946
- primaryKey?: boolean | undefined;
947
- }, {
948
- type: "number";
949
- label?: string | undefined;
950
- optional?: boolean | undefined;
951
- unique?: boolean | undefined;
952
- default?: number | undefined;
953
- primaryKey?: boolean | undefined;
954
- }>, z.ZodObject<{
955
- label: z.ZodOptional<z.ZodString>;
956
- optional: z.ZodOptional<z.ZodBoolean>;
957
- unique: z.ZodOptional<z.ZodBoolean>;
958
- type: z.ZodLiteral<"text">;
959
- multiline: z.ZodOptional<z.ZodBoolean>;
960
- default: z.ZodOptional<z.ZodString>;
961
- primaryKey: z.ZodOptional<z.ZodBoolean>;
962
- }, "strip", z.ZodTypeAny, {
963
- type: "text";
964
- label?: string | undefined;
965
- optional?: boolean | undefined;
966
- unique?: boolean | undefined;
967
- multiline?: boolean | undefined;
968
- default?: string | undefined;
969
- primaryKey?: boolean | undefined;
970
- }, {
971
- type: "text";
972
- label?: string | undefined;
973
- optional?: boolean | undefined;
974
- unique?: boolean | undefined;
975
- multiline?: boolean | undefined;
976
- default?: string | undefined;
977
- primaryKey?: boolean | undefined;
978
- }>, z.ZodObject<{
979
- label: z.ZodOptional<z.ZodString>;
980
- optional: z.ZodOptional<z.ZodBoolean>;
981
- unique: z.ZodOptional<z.ZodBoolean>;
982
- type: z.ZodLiteral<"date">;
983
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
984
- }, "strip", z.ZodTypeAny, {
985
- type: "date";
986
- label?: string | undefined;
987
- optional?: boolean | undefined;
988
- unique?: boolean | undefined;
989
- default?: string | undefined;
990
- }, {
991
- type: "date";
992
- label?: string | undefined;
993
- optional?: boolean | undefined;
994
- unique?: boolean | undefined;
995
- default?: Date | "now" | undefined;
996
- }>, z.ZodObject<{
997
- label: z.ZodOptional<z.ZodString>;
998
- optional: z.ZodOptional<z.ZodBoolean>;
999
- unique: z.ZodOptional<z.ZodBoolean>;
1000
- type: z.ZodLiteral<"json">;
1001
- default: z.ZodOptional<z.ZodUnknown>;
1002
- }, "strip", z.ZodTypeAny, {
1003
- type: "json";
1004
- label?: string | undefined;
1005
- optional?: boolean | undefined;
1006
- unique?: boolean | undefined;
1007
- default?: unknown;
1008
- }, {
1009
- type: "json";
1010
- label?: string | undefined;
1011
- optional?: boolean | undefined;
1012
- unique?: boolean | undefined;
1013
- default?: unknown;
1014
- }>]>>;
1015
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1016
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
1017
- unique: z.ZodOptional<z.ZodBoolean>;
1018
- }, "strip", z.ZodTypeAny, {
1019
- on: (string | string[]) & (string | string[] | undefined);
1020
- unique?: boolean | undefined;
1021
- }, {
1022
- on: (string | string[]) & (string | string[] | undefined);
1023
- unique?: boolean | undefined;
1024
- }>>>;
1025
- table: z.ZodAny;
1026
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
1027
- writable: z.ZodLiteral<true>;
1028
- }, "strip", z.ZodTypeAny, {
1029
- columns: Record<string, {
1030
- type: "boolean";
1031
- label?: string | undefined;
1032
- optional?: boolean | undefined;
1033
- unique?: boolean | undefined;
1034
- default?: boolean | undefined;
1035
- } | {
1036
- type: "number";
1037
- label?: string | undefined;
1038
- optional?: boolean | undefined;
1039
- unique?: boolean | undefined;
1040
- default?: number | undefined;
1041
- primaryKey?: boolean | undefined;
1042
- } | {
1043
- type: "text";
1044
- label?: string | undefined;
1045
- optional?: boolean | undefined;
1046
- unique?: boolean | undefined;
1047
- multiline?: boolean | undefined;
1048
- default?: string | undefined;
1049
- primaryKey?: boolean | undefined;
1050
- } | {
1051
- type: "date";
1052
- label?: string | undefined;
1053
- optional?: boolean | undefined;
1054
- unique?: boolean | undefined;
1055
- default?: string | undefined;
1056
- } | {
1057
- type: "json";
1058
- label?: string | undefined;
1059
- optional?: boolean | undefined;
1060
- unique?: boolean | undefined;
1061
- default?: unknown;
1062
- }>;
1063
- writable: true;
1064
- indexes?: Record<string, {
1065
- on: (string | string[]) & (string | string[] | undefined);
1066
- unique?: boolean | undefined;
1067
- }> | undefined;
1068
- table?: any;
1069
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1070
- }, {
1071
- columns: Record<string, {
1072
- type: "boolean";
1073
- label?: string | undefined;
1074
- optional?: boolean | undefined;
1075
- unique?: boolean | undefined;
1076
- default?: boolean | undefined;
1077
- } | {
1078
- type: "number";
1079
- label?: string | undefined;
1080
- optional?: boolean | undefined;
1081
- unique?: boolean | undefined;
1082
- default?: number | undefined;
1083
- primaryKey?: boolean | undefined;
1084
- } | {
1085
- type: "text";
1086
- label?: string | undefined;
1087
- optional?: boolean | undefined;
1088
- unique?: boolean | undefined;
1089
- multiline?: boolean | undefined;
1090
- default?: string | undefined;
1091
- primaryKey?: boolean | undefined;
1092
- } | {
1093
- type: "date";
1094
- label?: string | undefined;
1095
- optional?: boolean | undefined;
1096
- unique?: boolean | undefined;
1097
- default?: Date | "now" | undefined;
1098
- } | {
1099
- type: "json";
1100
- label?: string | undefined;
1101
- optional?: boolean | undefined;
1102
- unique?: boolean | undefined;
1103
- default?: unknown;
1104
- }>;
1105
- writable: true;
1106
- indexes?: Record<string, {
1107
- on: (string | string[]) & (string | string[] | undefined);
1108
- unique?: boolean | undefined;
1109
- }> | undefined;
1110
- table?: any;
1111
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1112
- }>]>;
1113
- export declare const collectionsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
1114
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
1115
- label: z.ZodOptional<z.ZodString>;
1116
- optional: z.ZodOptional<z.ZodBoolean>;
1117
- unique: z.ZodOptional<z.ZodBoolean>;
1118
- type: z.ZodLiteral<"boolean">;
1119
- default: z.ZodOptional<z.ZodBoolean>;
1120
- }, "strip", z.ZodTypeAny, {
1121
- type: "boolean";
1122
- label?: string | undefined;
1123
- optional?: boolean | undefined;
1124
- unique?: boolean | undefined;
1125
- default?: boolean | undefined;
1126
- }, {
1127
- type: "boolean";
1128
- label?: string | undefined;
1129
- optional?: boolean | undefined;
1130
- unique?: boolean | undefined;
1131
- default?: boolean | undefined;
1132
- }>, z.ZodObject<{
1133
- label: z.ZodOptional<z.ZodString>;
1134
- optional: z.ZodOptional<z.ZodBoolean>;
1135
- unique: z.ZodOptional<z.ZodBoolean>;
1136
- type: z.ZodLiteral<"number">;
1137
- default: z.ZodOptional<z.ZodNumber>;
1138
- primaryKey: z.ZodOptional<z.ZodBoolean>;
1139
- }, "strip", z.ZodTypeAny, {
1140
- type: "number";
1141
- label?: string | undefined;
1142
- optional?: boolean | undefined;
1143
- unique?: boolean | undefined;
1144
- default?: number | undefined;
1145
- primaryKey?: boolean | undefined;
1146
- }, {
1147
- type: "number";
1148
- label?: string | undefined;
1149
- optional?: boolean | undefined;
1150
- unique?: boolean | undefined;
1151
- default?: number | undefined;
1152
- primaryKey?: boolean | undefined;
1153
- }>, z.ZodObject<{
1154
- label: z.ZodOptional<z.ZodString>;
1155
- optional: z.ZodOptional<z.ZodBoolean>;
1156
- unique: z.ZodOptional<z.ZodBoolean>;
1157
- type: z.ZodLiteral<"text">;
1158
- multiline: z.ZodOptional<z.ZodBoolean>;
1159
- default: z.ZodOptional<z.ZodString>;
1160
- primaryKey: z.ZodOptional<z.ZodBoolean>;
1161
- }, "strip", z.ZodTypeAny, {
1162
- type: "text";
1163
- label?: string | undefined;
1164
- optional?: boolean | undefined;
1165
- unique?: boolean | undefined;
1166
- multiline?: boolean | undefined;
1167
- default?: string | undefined;
1168
- primaryKey?: boolean | undefined;
1169
- }, {
1170
- type: "text";
1171
- label?: string | undefined;
1172
- optional?: boolean | undefined;
1173
- unique?: boolean | undefined;
1174
- multiline?: boolean | undefined;
1175
- default?: string | undefined;
1176
- primaryKey?: boolean | undefined;
1177
- }>, z.ZodObject<{
1178
- label: z.ZodOptional<z.ZodString>;
1179
- optional: z.ZodOptional<z.ZodBoolean>;
1180
- unique: z.ZodOptional<z.ZodBoolean>;
1181
- type: z.ZodLiteral<"date">;
1182
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
1183
- }, "strip", z.ZodTypeAny, {
1184
- type: "date";
1185
- label?: string | undefined;
1186
- optional?: boolean | undefined;
1187
- unique?: boolean | undefined;
1188
- default?: string | undefined;
1189
- }, {
1190
- type: "date";
1191
- label?: string | undefined;
1192
- optional?: boolean | undefined;
1193
- unique?: boolean | undefined;
1194
- default?: Date | "now" | undefined;
1195
- }>, z.ZodObject<{
1196
- label: z.ZodOptional<z.ZodString>;
1197
- optional: z.ZodOptional<z.ZodBoolean>;
1198
- unique: z.ZodOptional<z.ZodBoolean>;
1199
- type: z.ZodLiteral<"json">;
1200
- default: z.ZodOptional<z.ZodUnknown>;
1201
- }, "strip", z.ZodTypeAny, {
1202
- type: "json";
1203
- label?: string | undefined;
1204
- optional?: boolean | undefined;
1205
- unique?: boolean | undefined;
1206
- default?: unknown;
1207
- }, {
1208
- type: "json";
1209
- label?: string | undefined;
1210
- optional?: boolean | undefined;
1211
- unique?: boolean | undefined;
1212
- default?: unknown;
1213
- }>]>>;
1214
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1215
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
1216
- unique: z.ZodOptional<z.ZodBoolean>;
1217
- }, "strip", z.ZodTypeAny, {
1218
- on: (string | string[]) & (string | string[] | undefined);
1219
- unique?: boolean | undefined;
1220
- }, {
1221
- on: (string | string[]) & (string | string[] | undefined);
1222
- unique?: boolean | undefined;
1223
- }>>>;
1224
- table: z.ZodAny;
1225
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
1226
- writable: z.ZodLiteral<false>;
1227
- }, "strip", z.ZodTypeAny, {
1228
- columns: Record<string, {
1229
- type: "boolean";
1230
- label?: string | undefined;
1231
- optional?: boolean | undefined;
1232
- unique?: boolean | undefined;
1233
- default?: boolean | undefined;
1234
- } | {
1235
- type: "number";
1236
- label?: string | undefined;
1237
- optional?: boolean | undefined;
1238
- unique?: boolean | undefined;
1239
- default?: number | undefined;
1240
- primaryKey?: boolean | undefined;
1241
- } | {
1242
- type: "text";
1243
- label?: string | undefined;
1244
- optional?: boolean | undefined;
1245
- unique?: boolean | undefined;
1246
- multiline?: boolean | undefined;
1247
- default?: string | undefined;
1248
- primaryKey?: boolean | undefined;
1249
- } | {
1250
- type: "date";
1251
- label?: string | undefined;
1252
- optional?: boolean | undefined;
1253
- unique?: boolean | undefined;
1254
- default?: string | undefined;
1255
- } | {
1256
- type: "json";
1257
- label?: string | undefined;
1258
- optional?: boolean | undefined;
1259
- unique?: boolean | undefined;
1260
- default?: unknown;
1261
- }>;
1262
- writable: false;
1263
- indexes?: Record<string, {
1264
- on: (string | string[]) & (string | string[] | undefined);
1265
- unique?: boolean | undefined;
1266
- }> | undefined;
1267
- table?: any;
1268
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1269
- }, {
1270
- columns: Record<string, {
1271
- type: "boolean";
1272
- label?: string | undefined;
1273
- optional?: boolean | undefined;
1274
- unique?: boolean | undefined;
1275
- default?: boolean | undefined;
1276
- } | {
1277
- type: "number";
1278
- label?: string | undefined;
1279
- optional?: boolean | undefined;
1280
- unique?: boolean | undefined;
1281
- default?: number | undefined;
1282
- primaryKey?: boolean | undefined;
1283
- } | {
1284
- type: "text";
1285
- label?: string | undefined;
1286
- optional?: boolean | undefined;
1287
- unique?: boolean | undefined;
1288
- multiline?: boolean | undefined;
1289
- default?: string | undefined;
1290
- primaryKey?: boolean | undefined;
1291
- } | {
1292
- type: "date";
1293
- label?: string | undefined;
1294
- optional?: boolean | undefined;
1295
- unique?: boolean | undefined;
1296
- default?: Date | "now" | undefined;
1297
- } | {
1298
- type: "json";
1299
- label?: string | undefined;
1300
- optional?: boolean | undefined;
1301
- unique?: boolean | undefined;
1302
- default?: unknown;
1303
- }>;
1304
- writable: false;
1305
- indexes?: Record<string, {
1306
- on: (string | string[]) & (string | string[] | undefined);
1307
- unique?: boolean | undefined;
1308
- }> | undefined;
1309
- table?: any;
1310
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1311
- }>, z.ZodObject<{
1312
- columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
1313
- label: z.ZodOptional<z.ZodString>;
1314
- optional: z.ZodOptional<z.ZodBoolean>;
1315
- unique: z.ZodOptional<z.ZodBoolean>;
1316
- type: z.ZodLiteral<"boolean">;
1317
- default: z.ZodOptional<z.ZodBoolean>;
1318
- }, "strip", z.ZodTypeAny, {
1319
- type: "boolean";
1320
- label?: string | undefined;
1321
- optional?: boolean | undefined;
1322
- unique?: boolean | undefined;
1323
- default?: boolean | undefined;
1324
- }, {
1325
- type: "boolean";
1326
- label?: string | undefined;
1327
- optional?: boolean | undefined;
1328
- unique?: boolean | undefined;
1329
- default?: boolean | undefined;
1330
- }>, z.ZodObject<{
1331
- label: z.ZodOptional<z.ZodString>;
1332
- optional: z.ZodOptional<z.ZodBoolean>;
1333
- unique: z.ZodOptional<z.ZodBoolean>;
1334
- type: z.ZodLiteral<"number">;
1335
- default: z.ZodOptional<z.ZodNumber>;
1336
- primaryKey: z.ZodOptional<z.ZodBoolean>;
1337
- }, "strip", z.ZodTypeAny, {
1338
- type: "number";
1339
- label?: string | undefined;
1340
- optional?: boolean | undefined;
1341
- unique?: boolean | undefined;
1342
- default?: number | undefined;
1343
- primaryKey?: boolean | undefined;
1344
- }, {
1345
- type: "number";
1346
- label?: string | undefined;
1347
- optional?: boolean | undefined;
1348
- unique?: boolean | undefined;
1349
- default?: number | undefined;
1350
- primaryKey?: boolean | undefined;
1351
- }>, z.ZodObject<{
1352
- label: z.ZodOptional<z.ZodString>;
1353
- optional: z.ZodOptional<z.ZodBoolean>;
1354
- unique: z.ZodOptional<z.ZodBoolean>;
1355
- type: z.ZodLiteral<"text">;
1356
- multiline: z.ZodOptional<z.ZodBoolean>;
1357
- default: z.ZodOptional<z.ZodString>;
1358
- primaryKey: z.ZodOptional<z.ZodBoolean>;
1359
- }, "strip", z.ZodTypeAny, {
1360
- type: "text";
1361
- label?: string | undefined;
1362
- optional?: boolean | undefined;
1363
- unique?: boolean | undefined;
1364
- multiline?: boolean | undefined;
1365
- default?: string | undefined;
1366
- primaryKey?: boolean | undefined;
1367
- }, {
1368
- type: "text";
1369
- label?: string | undefined;
1370
- optional?: boolean | undefined;
1371
- unique?: boolean | undefined;
1372
- multiline?: boolean | undefined;
1373
- default?: string | undefined;
1374
- primaryKey?: boolean | undefined;
1375
- }>, z.ZodObject<{
1376
- label: z.ZodOptional<z.ZodString>;
1377
- optional: z.ZodOptional<z.ZodBoolean>;
1378
- unique: z.ZodOptional<z.ZodBoolean>;
1379
- type: z.ZodLiteral<"date">;
1380
- default: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"now">, z.ZodEffects<z.ZodDate, string, Date>]>>;
1381
- }, "strip", z.ZodTypeAny, {
1382
- type: "date";
1383
- label?: string | undefined;
1384
- optional?: boolean | undefined;
1385
- unique?: boolean | undefined;
1386
- default?: string | undefined;
1387
- }, {
1388
- type: "date";
1389
- label?: string | undefined;
1390
- optional?: boolean | undefined;
1391
- unique?: boolean | undefined;
1392
- default?: Date | "now" | undefined;
1393
- }>, z.ZodObject<{
1394
- label: z.ZodOptional<z.ZodString>;
1395
- optional: z.ZodOptional<z.ZodBoolean>;
1396
- unique: z.ZodOptional<z.ZodBoolean>;
1397
- type: z.ZodLiteral<"json">;
1398
- default: z.ZodOptional<z.ZodUnknown>;
1399
- }, "strip", z.ZodTypeAny, {
1400
- type: "json";
1401
- label?: string | undefined;
1402
- optional?: boolean | undefined;
1403
- unique?: boolean | undefined;
1404
- default?: unknown;
1405
- }, {
1406
- type: "json";
1407
- label?: string | undefined;
1408
- optional?: boolean | undefined;
1409
- unique?: boolean | undefined;
1410
- default?: unknown;
1411
- }>]>>;
1412
- indexes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1413
- on: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
1414
- unique: z.ZodOptional<z.ZodBoolean>;
1415
- }, "strip", z.ZodTypeAny, {
1416
- on: (string | string[]) & (string | string[] | undefined);
1417
- unique?: boolean | undefined;
1418
- }, {
1419
- on: (string | string[]) & (string | string[] | undefined);
1420
- unique?: boolean | undefined;
1421
- }>>>;
1422
- table: z.ZodAny;
1423
- _setMeta: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>>;
1424
- writable: z.ZodLiteral<true>;
1425
- }, "strip", z.ZodTypeAny, {
1426
- columns: Record<string, {
1427
- type: "boolean";
1428
- label?: string | undefined;
1429
- optional?: boolean | undefined;
1430
- unique?: boolean | undefined;
1431
- default?: boolean | undefined;
1432
- } | {
1433
- type: "number";
1434
- label?: string | undefined;
1435
- optional?: boolean | undefined;
1436
- unique?: boolean | undefined;
1437
- default?: number | undefined;
1438
- primaryKey?: boolean | undefined;
1439
- } | {
1440
- type: "text";
1441
- label?: string | undefined;
1442
- optional?: boolean | undefined;
1443
- unique?: boolean | undefined;
1444
- multiline?: boolean | undefined;
1445
- default?: string | undefined;
1446
- primaryKey?: boolean | undefined;
1447
- } | {
1448
- type: "date";
1449
- label?: string | undefined;
1450
- optional?: boolean | undefined;
1451
- unique?: boolean | undefined;
1452
- default?: string | undefined;
1453
- } | {
1454
- type: "json";
1455
- label?: string | undefined;
1456
- optional?: boolean | undefined;
1457
- unique?: boolean | undefined;
1458
- default?: unknown;
1459
- }>;
1460
- writable: true;
1461
- indexes?: Record<string, {
1462
- on: (string | string[]) & (string | string[] | undefined);
1463
- unique?: boolean | undefined;
1464
- }> | undefined;
1465
- table?: any;
1466
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1467
- }, {
1468
- columns: Record<string, {
1469
- type: "boolean";
1470
- label?: string | undefined;
1471
- optional?: boolean | undefined;
1472
- unique?: boolean | undefined;
1473
- default?: boolean | undefined;
1474
- } | {
1475
- type: "number";
1476
- label?: string | undefined;
1477
- optional?: boolean | undefined;
1478
- unique?: boolean | undefined;
1479
- default?: number | undefined;
1480
- primaryKey?: boolean | undefined;
1481
- } | {
1482
- type: "text";
1483
- label?: string | undefined;
1484
- optional?: boolean | undefined;
1485
- unique?: boolean | undefined;
1486
- multiline?: boolean | undefined;
1487
- default?: string | undefined;
1488
- primaryKey?: boolean | undefined;
1489
- } | {
1490
- type: "date";
1491
- label?: string | undefined;
1492
- optional?: boolean | undefined;
1493
- unique?: boolean | undefined;
1494
- default?: Date | "now" | undefined;
1495
- } | {
1496
- type: "json";
1497
- label?: string | undefined;
1498
- optional?: boolean | undefined;
1499
- unique?: boolean | undefined;
1500
- default?: unknown;
1501
- }>;
1502
- writable: true;
1503
- indexes?: Record<string, {
1504
- on: (string | string[]) & (string | string[] | undefined);
1505
- unique?: boolean | undefined;
1506
- }> | undefined;
1507
- table?: any;
1508
- _setMeta?: ((...args: unknown[]) => unknown) | undefined;
1509
- }>]>>;
1510
- export type BooleanColumn = z.infer<typeof booleanColumnSchema>;
1511
- export type NumberColumn = z.infer<typeof numberColumnSchema>;
1512
- export type TextColumn = z.infer<typeof textColumnSchema>;
1513
- export type DateColumn = z.infer<typeof dateColumnSchema>;
1514
- export type DateColumnInput = z.input<typeof dateColumnSchema>;
1515
- export type JsonColumn = z.infer<typeof jsonColumnSchema>;
1516
- export type ColumnType = BooleanColumn['type'] | NumberColumn['type'] | TextColumn['type'] | DateColumn['type'] | JsonColumn['type'];
1517
- export type DBColumn = z.infer<typeof columnSchema>;
1518
- export type DBColumnInput = DateColumnInput | BooleanColumn | NumberColumn | TextColumn | JsonColumn;
1519
- export type DBColumns = z.infer<typeof columnsSchema>;
1520
- export type DBCollection = z.infer<typeof readableCollectionSchema | typeof writableCollectionSchema>;
1521
- export type DBCollections = Record<string, DBCollection>;
1522
- export type DBSnapshot = {
1523
- schema: Record<string, DBCollection>;
1524
- /**
1525
- * Snapshot version. Breaking changes to the snapshot format increment this number.
1526
- * @todo Rename to "version" once closer to release.
1527
- */
1528
- experimentalVersion: number;
1529
- };
1530
- export type ReadableDBCollection = z.infer<typeof readableCollectionSchema>;
1531
- export type WritableDBCollection = z.infer<typeof writableCollectionSchema>;
1532
- type GeneratedConfig<T extends ColumnDataType = ColumnDataType> = Pick<ColumnBaseConfig<T, string>, 'name' | 'tableName' | 'notNull' | 'hasDefault'>;
1533
- export type AstroText<T extends GeneratedConfig<'string'>> = SQLiteColumn<T & {
1534
- data: string;
1535
- dataType: 'string';
1536
- columnType: 'SQLiteText';
1537
- driverParam: string;
1538
- enumValues: never;
1539
- baseColumn: never;
1540
- }>;
1541
- export type AstroDate<T extends GeneratedConfig<'custom'>> = SQLiteColumn<T & {
1542
- data: Date;
1543
- dataType: 'custom';
1544
- columnType: 'SQLiteCustomColumn';
1545
- driverParam: string;
1546
- enumValues: never;
1547
- baseColumn: never;
1548
- }>;
1549
- export type AstroBoolean<T extends GeneratedConfig<'boolean'>> = SQLiteColumn<T & {
1550
- data: boolean;
1551
- dataType: 'boolean';
1552
- columnType: 'SQLiteBoolean';
1553
- driverParam: number;
1554
- enumValues: never;
1555
- baseColumn: never;
1556
- }>;
1557
- export type AstroNumber<T extends GeneratedConfig<'number'>> = SQLiteColumn<T & {
1558
- data: number;
1559
- dataType: 'number';
1560
- columnType: 'SQLiteInteger';
1561
- driverParam: number;
1562
- enumValues: never;
1563
- baseColumn: never;
1564
- }>;
1565
- export type AstroJson<T extends GeneratedConfig<'custom'>> = SQLiteColumn<T & {
1566
- data: unknown;
1567
- dataType: 'custom';
1568
- columnType: 'SQLiteCustomColumn';
1569
- driverParam: string;
1570
- enumValues: never;
1571
- baseColumn: never;
1572
- }>;
1573
- export type AstroId<T extends Pick<GeneratedConfig<'string'>, 'tableName'>> = SQLiteColumn<T & {
1574
- name: 'id';
1575
- hasDefault: true;
1576
- notNull: true;
1577
- data: string;
1578
- dataType: 'custom';
1579
- columnType: 'SQLiteCustomColumn';
1580
- driverParam: string;
1581
- enumValues: never;
1582
- baseColumn: never;
1583
- }>;
1584
- export type MaybePromise<T> = T | Promise<T>;
1585
- export type MaybeArray<T> = T | T[];
1586
- export type Column<T extends DBColumn['type'], S extends GeneratedConfig> = T extends 'boolean' ? AstroBoolean<S> : T extends 'number' ? AstroNumber<S> : T extends 'text' ? AstroText<S> : T extends 'date' ? AstroDate<S> : T extends 'json' ? AstroJson<S> : never;
1587
- export type Table<TTableName extends string, TColumns extends Record<string, Pick<DBColumn, 'type' | 'default' | 'optional'>>> = SQLiteTableWithColumns<{
1588
- name: TTableName;
1589
- schema: undefined;
1590
- dialect: 'sqlite';
1591
- columns: {
1592
- id: AstroId<{
1593
- tableName: TTableName;
1594
- }>;
1595
- } & {
1596
- [K in Extract<keyof TColumns, string>]: Column<TColumns[K]['type'], {
1597
- tableName: TTableName;
1598
- name: K;
1599
- hasDefault: TColumns[K]['default'] extends undefined ? false : true;
1600
- notNull: TColumns[K]['optional'] extends true ? false : true;
1601
- }>;
1602
- };
1603
- }>;
1604
- export {};