@astrojs/db 0.14.14 → 0.15.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.
@@ -5,16 +5,16 @@ import type { NumberColumn, TextColumn } from './types.js';
5
5
  export type MaybeArray<T> = T | T[];
6
6
  export declare const booleanColumnSchema: z.ZodObject<{
7
7
  type: z.ZodLiteral<"boolean">;
8
- schema: z.ZodObject<z.objectUtil.extendShape<{
8
+ schema: z.ZodObject<{
9
9
  label: z.ZodOptional<z.ZodString>;
10
10
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
11
11
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
12
12
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13
13
  name: z.ZodOptional<z.ZodString>;
14
14
  collection: z.ZodOptional<z.ZodString>;
15
- }, {
15
+ } & {
16
16
  default: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>]>>;
17
- }>, "strip", z.ZodTypeAny, {
17
+ }, "strip", z.ZodTypeAny, {
18
18
  optional: boolean;
19
19
  unique: boolean;
20
20
  deprecated: boolean;
@@ -177,17 +177,17 @@ export declare const numberColumnSchema: z.ZodObject<{
177
177
  references?: () => z.input<typeof numberColumnSchema>;
178
178
  };
179
179
  }>;
180
- declare const textColumnBaseSchema: z.ZodIntersection<z.ZodObject<z.objectUtil.extendShape<Omit<{
180
+ declare const textColumnBaseSchema: z.ZodIntersection<z.ZodObject<Omit<{
181
181
  label: z.ZodOptional<z.ZodString>;
182
182
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
183
183
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
184
184
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
185
185
  name: z.ZodOptional<z.ZodString>;
186
186
  collection: z.ZodOptional<z.ZodString>;
187
- }, "optional">, {
187
+ }, "optional"> & {
188
188
  default: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>]>>;
189
189
  multiline: z.ZodOptional<z.ZodBoolean>;
190
- }>, "strip", z.ZodTypeAny, {
190
+ }, "strip", z.ZodTypeAny, {
191
191
  unique: boolean;
192
192
  deprecated: boolean;
193
193
  name?: string | undefined;
@@ -303,16 +303,16 @@ export declare const textColumnSchema: z.ZodObject<{
303
303
  }>;
304
304
  export declare const dateColumnSchema: z.ZodObject<{
305
305
  type: z.ZodLiteral<"date">;
306
- schema: z.ZodObject<z.objectUtil.extendShape<{
306
+ schema: z.ZodObject<{
307
307
  label: z.ZodOptional<z.ZodString>;
308
308
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
309
309
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
310
310
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
311
311
  name: z.ZodOptional<z.ZodString>;
312
312
  collection: z.ZodOptional<z.ZodString>;
313
- }, {
313
+ } & {
314
314
  default: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>, z.ZodEffects<z.ZodDate, string, Date>]>>;
315
- }>, "strip", z.ZodTypeAny, {
315
+ }, "strip", z.ZodTypeAny, {
316
316
  optional: boolean;
317
317
  unique: boolean;
318
318
  deprecated: boolean;
@@ -354,16 +354,16 @@ export declare const dateColumnSchema: z.ZodObject<{
354
354
  }>;
355
355
  export declare const jsonColumnSchema: z.ZodObject<{
356
356
  type: z.ZodLiteral<"json">;
357
- schema: z.ZodObject<z.objectUtil.extendShape<{
357
+ schema: z.ZodObject<{
358
358
  label: z.ZodOptional<z.ZodString>;
359
359
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
360
360
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
361
361
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
362
362
  name: z.ZodOptional<z.ZodString>;
363
363
  collection: z.ZodOptional<z.ZodString>;
364
- }, {
364
+ } & {
365
365
  default: z.ZodOptional<z.ZodUnknown>;
366
- }>, "strip", z.ZodTypeAny, {
366
+ }, "strip", z.ZodTypeAny, {
367
367
  optional: boolean;
368
368
  unique: boolean;
369
369
  deprecated: boolean;
@@ -405,16 +405,16 @@ export declare const jsonColumnSchema: z.ZodObject<{
405
405
  }>;
406
406
  export declare const columnSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
407
407
  type: z.ZodLiteral<"boolean">;
408
- schema: z.ZodObject<z.objectUtil.extendShape<{
408
+ schema: z.ZodObject<{
409
409
  label: z.ZodOptional<z.ZodString>;
410
410
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
411
411
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
412
412
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
413
413
  name: z.ZodOptional<z.ZodString>;
414
414
  collection: z.ZodOptional<z.ZodString>;
415
- }, {
415
+ } & {
416
416
  default: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>]>>;
417
- }>, "strip", z.ZodTypeAny, {
417
+ }, "strip", z.ZodTypeAny, {
418
418
  optional: boolean;
419
419
  unique: boolean;
420
420
  deprecated: boolean;
@@ -601,16 +601,16 @@ export declare const columnSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
601
601
  };
602
602
  }>, z.ZodObject<{
603
603
  type: z.ZodLiteral<"date">;
604
- schema: z.ZodObject<z.objectUtil.extendShape<{
604
+ schema: z.ZodObject<{
605
605
  label: z.ZodOptional<z.ZodString>;
606
606
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
607
607
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
608
608
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
609
609
  name: z.ZodOptional<z.ZodString>;
610
610
  collection: z.ZodOptional<z.ZodString>;
611
- }, {
611
+ } & {
612
612
  default: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>, z.ZodEffects<z.ZodDate, string, Date>]>>;
613
- }>, "strip", z.ZodTypeAny, {
613
+ }, "strip", z.ZodTypeAny, {
614
614
  optional: boolean;
615
615
  unique: boolean;
616
616
  deprecated: boolean;
@@ -651,16 +651,16 @@ export declare const columnSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
651
651
  };
652
652
  }>, z.ZodObject<{
653
653
  type: z.ZodLiteral<"json">;
654
- schema: z.ZodObject<z.objectUtil.extendShape<{
654
+ schema: z.ZodObject<{
655
655
  label: z.ZodOptional<z.ZodString>;
656
656
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
657
657
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
658
658
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
659
659
  name: z.ZodOptional<z.ZodString>;
660
660
  collection: z.ZodOptional<z.ZodString>;
661
- }, {
661
+ } & {
662
662
  default: z.ZodOptional<z.ZodUnknown>;
663
- }>, "strip", z.ZodTypeAny, {
663
+ }, "strip", z.ZodTypeAny, {
664
664
  optional: boolean;
665
665
  unique: boolean;
666
666
  deprecated: boolean;
@@ -849,16 +849,16 @@ export declare const referenceableColumnSchema: z.ZodUnion<[z.ZodObject<{
849
849
  }>]>;
850
850
  export declare const columnsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
851
851
  type: z.ZodLiteral<"boolean">;
852
- schema: z.ZodObject<z.objectUtil.extendShape<{
852
+ schema: z.ZodObject<{
853
853
  label: z.ZodOptional<z.ZodString>;
854
854
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
855
855
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
856
856
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
857
857
  name: z.ZodOptional<z.ZodString>;
858
858
  collection: z.ZodOptional<z.ZodString>;
859
- }, {
859
+ } & {
860
860
  default: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>]>>;
861
- }>, "strip", z.ZodTypeAny, {
861
+ }, "strip", z.ZodTypeAny, {
862
862
  optional: boolean;
863
863
  unique: boolean;
864
864
  deprecated: boolean;
@@ -1045,16 +1045,16 @@ export declare const columnsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedU
1045
1045
  };
1046
1046
  }>, z.ZodObject<{
1047
1047
  type: z.ZodLiteral<"date">;
1048
- schema: z.ZodObject<z.objectUtil.extendShape<{
1048
+ schema: z.ZodObject<{
1049
1049
  label: z.ZodOptional<z.ZodString>;
1050
1050
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1051
1051
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1052
1052
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1053
1053
  name: z.ZodOptional<z.ZodString>;
1054
1054
  collection: z.ZodOptional<z.ZodString>;
1055
- }, {
1055
+ } & {
1056
1056
  default: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>, z.ZodEffects<z.ZodDate, string, Date>]>>;
1057
- }>, "strip", z.ZodTypeAny, {
1057
+ }, "strip", z.ZodTypeAny, {
1058
1058
  optional: boolean;
1059
1059
  unique: boolean;
1060
1060
  deprecated: boolean;
@@ -1095,16 +1095,16 @@ export declare const columnsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedU
1095
1095
  };
1096
1096
  }>, z.ZodObject<{
1097
1097
  type: z.ZodLiteral<"json">;
1098
- schema: z.ZodObject<z.objectUtil.extendShape<{
1098
+ schema: z.ZodObject<{
1099
1099
  label: z.ZodOptional<z.ZodString>;
1100
1100
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1101
1101
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1102
1102
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1103
1103
  name: z.ZodOptional<z.ZodString>;
1104
1104
  collection: z.ZodOptional<z.ZodString>;
1105
- }, {
1105
+ } & {
1106
1106
  default: z.ZodOptional<z.ZodUnknown>;
1107
- }>, "strip", z.ZodTypeAny, {
1107
+ }, "strip", z.ZodTypeAny, {
1108
1108
  optional: boolean;
1109
1109
  unique: boolean;
1110
1110
  deprecated: boolean;
@@ -1177,16 +1177,16 @@ export declare const indexSchema: z.ZodObject<{
1177
1177
  export declare const tableSchema: z.ZodObject<{
1178
1178
  columns: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1179
1179
  type: z.ZodLiteral<"boolean">;
1180
- schema: z.ZodObject<z.objectUtil.extendShape<{
1180
+ schema: z.ZodObject<{
1181
1181
  label: z.ZodOptional<z.ZodString>;
1182
1182
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1183
1183
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1184
1184
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1185
1185
  name: z.ZodOptional<z.ZodString>;
1186
1186
  collection: z.ZodOptional<z.ZodString>;
1187
- }, {
1187
+ } & {
1188
1188
  default: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>]>>;
1189
- }>, "strip", z.ZodTypeAny, {
1189
+ }, "strip", z.ZodTypeAny, {
1190
1190
  optional: boolean;
1191
1191
  unique: boolean;
1192
1192
  deprecated: boolean;
@@ -1373,16 +1373,16 @@ export declare const tableSchema: z.ZodObject<{
1373
1373
  };
1374
1374
  }>, z.ZodObject<{
1375
1375
  type: z.ZodLiteral<"date">;
1376
- schema: z.ZodObject<z.objectUtil.extendShape<{
1376
+ schema: z.ZodObject<{
1377
1377
  label: z.ZodOptional<z.ZodString>;
1378
1378
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1379
1379
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1380
1380
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1381
1381
  name: z.ZodOptional<z.ZodString>;
1382
1382
  collection: z.ZodOptional<z.ZodString>;
1383
- }, {
1383
+ } & {
1384
1384
  default: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>, z.ZodEffects<z.ZodDate, string, Date>]>>;
1385
- }>, "strip", z.ZodTypeAny, {
1385
+ }, "strip", z.ZodTypeAny, {
1386
1386
  optional: boolean;
1387
1387
  unique: boolean;
1388
1388
  deprecated: boolean;
@@ -1423,16 +1423,16 @@ export declare const tableSchema: z.ZodObject<{
1423
1423
  };
1424
1424
  }>, z.ZodObject<{
1425
1425
  type: z.ZodLiteral<"json">;
1426
- schema: z.ZodObject<z.objectUtil.extendShape<{
1426
+ schema: z.ZodObject<{
1427
1427
  label: z.ZodOptional<z.ZodString>;
1428
1428
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1429
1429
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1430
1430
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1431
1431
  name: z.ZodOptional<z.ZodString>;
1432
1432
  collection: z.ZodOptional<z.ZodString>;
1433
- }, {
1433
+ } & {
1434
1434
  default: z.ZodOptional<z.ZodUnknown>;
1435
- }>, "strip", z.ZodTypeAny, {
1435
+ }, "strip", z.ZodTypeAny, {
1436
1436
  optional: boolean;
1437
1437
  unique: boolean;
1438
1438
  deprecated: boolean;
@@ -1666,16 +1666,16 @@ export declare const tableSchema: z.ZodObject<{
1666
1666
  export declare const tablesSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
1667
1667
  columns: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1668
1668
  type: z.ZodLiteral<"boolean">;
1669
- schema: z.ZodObject<z.objectUtil.extendShape<{
1669
+ schema: z.ZodObject<{
1670
1670
  label: z.ZodOptional<z.ZodString>;
1671
1671
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1672
1672
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1673
1673
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1674
1674
  name: z.ZodOptional<z.ZodString>;
1675
1675
  collection: z.ZodOptional<z.ZodString>;
1676
- }, {
1676
+ } & {
1677
1677
  default: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>]>>;
1678
- }>, "strip", z.ZodTypeAny, {
1678
+ }, "strip", z.ZodTypeAny, {
1679
1679
  optional: boolean;
1680
1680
  unique: boolean;
1681
1681
  deprecated: boolean;
@@ -1862,16 +1862,16 @@ export declare const tablesSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodOb
1862
1862
  };
1863
1863
  }>, z.ZodObject<{
1864
1864
  type: z.ZodLiteral<"date">;
1865
- schema: z.ZodObject<z.objectUtil.extendShape<{
1865
+ schema: z.ZodObject<{
1866
1866
  label: z.ZodOptional<z.ZodString>;
1867
1867
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1868
1868
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1869
1869
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1870
1870
  name: z.ZodOptional<z.ZodString>;
1871
1871
  collection: z.ZodOptional<z.ZodString>;
1872
- }, {
1872
+ } & {
1873
1873
  default: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>, z.ZodEffects<z.ZodDate, string, Date>]>>;
1874
- }>, "strip", z.ZodTypeAny, {
1874
+ }, "strip", z.ZodTypeAny, {
1875
1875
  optional: boolean;
1876
1876
  unique: boolean;
1877
1877
  deprecated: boolean;
@@ -1912,16 +1912,16 @@ export declare const tablesSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodOb
1912
1912
  };
1913
1913
  }>, z.ZodObject<{
1914
1914
  type: z.ZodLiteral<"json">;
1915
- schema: z.ZodObject<z.objectUtil.extendShape<{
1915
+ schema: z.ZodObject<{
1916
1916
  label: z.ZodOptional<z.ZodString>;
1917
1917
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1918
1918
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1919
1919
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1920
1920
  name: z.ZodOptional<z.ZodString>;
1921
1921
  collection: z.ZodOptional<z.ZodString>;
1922
- }, {
1922
+ } & {
1923
1923
  default: z.ZodOptional<z.ZodUnknown>;
1924
- }>, "strip", z.ZodTypeAny, {
1924
+ }, "strip", z.ZodTypeAny, {
1925
1925
  optional: boolean;
1926
1926
  unique: boolean;
1927
1927
  deprecated: boolean;
@@ -2239,16 +2239,16 @@ export declare const dbConfigSchema: z.ZodEffects<z.ZodObject<{
2239
2239
  tables: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
2240
2240
  columns: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2241
2241
  type: z.ZodLiteral<"boolean">;
2242
- schema: z.ZodObject<z.objectUtil.extendShape<{
2242
+ schema: z.ZodObject<{
2243
2243
  label: z.ZodOptional<z.ZodString>;
2244
2244
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2245
2245
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2246
2246
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2247
2247
  name: z.ZodOptional<z.ZodString>;
2248
2248
  collection: z.ZodOptional<z.ZodString>;
2249
- }, {
2249
+ } & {
2250
2250
  default: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>]>>;
2251
- }>, "strip", z.ZodTypeAny, {
2251
+ }, "strip", z.ZodTypeAny, {
2252
2252
  optional: boolean;
2253
2253
  unique: boolean;
2254
2254
  deprecated: boolean;
@@ -2435,16 +2435,16 @@ export declare const dbConfigSchema: z.ZodEffects<z.ZodObject<{
2435
2435
  };
2436
2436
  }>, z.ZodObject<{
2437
2437
  type: z.ZodLiteral<"date">;
2438
- schema: z.ZodObject<z.objectUtil.extendShape<{
2438
+ schema: z.ZodObject<{
2439
2439
  label: z.ZodOptional<z.ZodString>;
2440
2440
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2441
2441
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2442
2442
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2443
2443
  name: z.ZodOptional<z.ZodString>;
2444
2444
  collection: z.ZodOptional<z.ZodString>;
2445
- }, {
2445
+ } & {
2446
2446
  default: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodType<SQL<any>, ZodTypeDef, SQL<any>>, SerializedSQL, SQL<any>>, z.ZodEffects<z.ZodDate, string, Date>]>>;
2447
- }>, "strip", z.ZodTypeAny, {
2447
+ }, "strip", z.ZodTypeAny, {
2448
2448
  optional: boolean;
2449
2449
  unique: boolean;
2450
2450
  deprecated: boolean;
@@ -2485,16 +2485,16 @@ export declare const dbConfigSchema: z.ZodEffects<z.ZodObject<{
2485
2485
  };
2486
2486
  }>, z.ZodObject<{
2487
2487
  type: z.ZodLiteral<"json">;
2488
- schema: z.ZodObject<z.objectUtil.extendShape<{
2488
+ schema: z.ZodObject<{
2489
2489
  label: z.ZodOptional<z.ZodString>;
2490
2490
  optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2491
2491
  unique: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2492
2492
  deprecated: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2493
2493
  name: z.ZodOptional<z.ZodString>;
2494
2494
  collection: z.ZodOptional<z.ZodString>;
2495
- }, {
2495
+ } & {
2496
2496
  default: z.ZodOptional<z.ZodUnknown>;
2497
- }>, "strip", z.ZodTypeAny, {
2497
+ }, "strip", z.ZodTypeAny, {
2498
2498
  optional: boolean;
2499
2499
  unique: boolean;
2500
2500
  deprecated: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { z } from 'zod';
2
- import type { MaybeArray, booleanColumnSchema, columnSchema, columnsSchema, dateColumnSchema, dbConfigSchema, indexSchema, jsonColumnSchema, numberColumnOptsSchema, numberColumnSchema, referenceableColumnSchema, resolvedIndexSchema, tableSchema, textColumnOptsSchema, textColumnSchema } from './schemas.js';
2
+ import type { booleanColumnSchema, columnSchema, columnsSchema, dateColumnSchema, dbConfigSchema, indexSchema, jsonColumnSchema, MaybeArray, numberColumnOptsSchema, numberColumnSchema, referenceableColumnSchema, resolvedIndexSchema, tableSchema, textColumnOptsSchema, textColumnSchema } from './schemas.js';
3
3
  export type ResolvedIndexes = z.output<typeof dbConfigSchema>['tables'][string]['indexes'];
4
4
  export type BooleanColumn = z.infer<typeof booleanColumnSchema>;
5
5
  export type BooleanColumnInput = z.input<typeof booleanColumnSchema>;
@@ -9,6 +9,9 @@ type AstroText<T extends GeneratedConfig<'string'>> = SQLiteColumn<T & {
9
9
  driverParam: string;
10
10
  enumValues: never;
11
11
  baseColumn: never;
12
+ isPrimaryKey: boolean;
13
+ isAutoincrement: boolean;
14
+ hasRuntimeDefault: boolean;
12
15
  }>;
13
16
  type AstroDate<T extends GeneratedConfig<'custom'>> = SQLiteColumn<T & {
14
17
  data: Date;
@@ -17,6 +20,9 @@ type AstroDate<T extends GeneratedConfig<'custom'>> = SQLiteColumn<T & {
17
20
  driverParam: string;
18
21
  enumValues: never;
19
22
  baseColumn: never;
23
+ isPrimaryKey: boolean;
24
+ isAutoincrement: boolean;
25
+ hasRuntimeDefault: boolean;
20
26
  }>;
21
27
  type AstroBoolean<T extends GeneratedConfig<'boolean'>> = SQLiteColumn<T & {
22
28
  data: boolean;
@@ -25,6 +31,9 @@ type AstroBoolean<T extends GeneratedConfig<'boolean'>> = SQLiteColumn<T & {
25
31
  driverParam: number;
26
32
  enumValues: never;
27
33
  baseColumn: never;
34
+ isPrimaryKey: boolean;
35
+ isAutoincrement: boolean;
36
+ hasRuntimeDefault: boolean;
28
37
  }>;
29
38
  type AstroNumber<T extends GeneratedConfig<'number'>> = SQLiteColumn<T & {
30
39
  data: number;
@@ -33,6 +42,9 @@ type AstroNumber<T extends GeneratedConfig<'number'>> = SQLiteColumn<T & {
33
42
  driverParam: number;
34
43
  enumValues: never;
35
44
  baseColumn: never;
45
+ isPrimaryKey: boolean;
46
+ isAutoincrement: boolean;
47
+ hasRuntimeDefault: boolean;
36
48
  }>;
37
49
  type AstroJson<T extends GeneratedConfig<'custom'>> = SQLiteColumn<T & {
38
50
  data: unknown;
@@ -41,6 +53,9 @@ type AstroJson<T extends GeneratedConfig<'custom'>> = SQLiteColumn<T & {
41
53
  driverParam: string;
42
54
  enumValues: never;
43
55
  baseColumn: never;
56
+ isPrimaryKey: boolean;
57
+ isAutoincrement: boolean;
58
+ hasRuntimeDefault: boolean;
44
59
  }>;
45
60
  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;
46
61
  export type Table<TTableName extends string, TColumns extends OutputColumnsConfig | ColumnsConfig> = SQLiteTableWithColumns<{
@@ -1,4 +1,4 @@
1
- import type { BooleanColumnInput, ColumnsConfig, DBConfigInput, DateColumnInput, JsonColumnInput, NumberColumnOpts, TableConfig, TextColumnOpts } from '../core/types.js';
1
+ import type { BooleanColumnInput, ColumnsConfig, DateColumnInput, DBConfigInput, JsonColumnInput, NumberColumnOpts, TableConfig, TextColumnOpts } from '../core/types.js';
2
2
  export declare const column: {
3
3
  number: <T extends NumberColumnOpts>(opts?: T) => {
4
4
  type: "number";
@@ -43,6 +43,6 @@ export declare function defineDb(userConfig: DBConfigInput): {
43
43
  export declare const NOW: import("drizzle-orm").SQL<unknown>;
44
44
  export declare const TRUE: import("drizzle-orm").SQL<unknown>;
45
45
  export declare const FALSE: import("drizzle-orm").SQL<unknown>;
46
- export { sql, eq, gt, gte, lt, lte, ne, isNull, isNotNull, inArray, notInArray, exists, notExists, between, notBetween, like, ilike, notIlike, not, asc, desc, and, or, count, countDistinct, avg, avgDistinct, sum, sumDistinct, max, min, } from 'drizzle-orm';
46
+ export { and, asc, avg, avgDistinct, between, count, countDistinct, desc, eq, exists, gt, gte, ilike, inArray, isNotNull, isNull, like, lt, lte, max, min, ne, not, notBetween, notExists, notIlike, notInArray, or, sql, sum, sumDistinct, } from 'drizzle-orm';
47
47
  export { alias } from 'drizzle-orm/sqlite-core';
48
48
  export { isDbError } from './utils.js';
@@ -2,10 +2,10 @@ import { mkdir, writeFile } from "node:fs/promises";
2
2
  import { homedir } from "node:os";
3
3
  import { basename } from "node:path";
4
4
  import {
5
- MISSING_SESSION_ID_ERROR,
6
- PROJECT_ID_FILE,
7
5
  getAstroStudioUrl,
8
- getSessionIdFromFile
6
+ getSessionIdFromFile,
7
+ MISSING_SESSION_ID_ERROR,
8
+ PROJECT_ID_FILE
9
9
  } from "@astrojs/studio";
10
10
  import { slug } from "github-slugger";
11
11
  import { bgRed, cyan } from "kleur/colors";
@@ -1,6 +1,6 @@
1
1
  import { mkdir, writeFile } from "node:fs/promises";
2
2
  import { createServer as _createServer } from "node:http";
3
- import { SESSION_LOGIN_FILE, getAstroStudioUrl } from "@astrojs/studio";
3
+ import { getAstroStudioUrl, SESSION_LOGIN_FILE } from "@astrojs/studio";
4
4
  import { listen } from "async-listen";
5
5
  import { cyan } from "kleur/colors";
6
6
  import open from "open";
@@ -4,8 +4,7 @@ import { sql } from "drizzle-orm";
4
4
  import { SQLiteAsyncDialect } from "drizzle-orm/sqlite-core";
5
5
  import * as color from "kleur/colors";
6
6
  import { customAlphabet } from "nanoid";
7
- import { hasPrimaryKey } from "../../runtime/index.js";
8
- import { createRemoteDatabaseClient } from "../../runtime/index.js";
7
+ import { createRemoteDatabaseClient, hasPrimaryKey } from "../../runtime/index.js";
9
8
  import { isSerializedSQL } from "../../runtime/types.js";
10
9
  import { isDbError, safeFetch } from "../../runtime/utils.js";
11
10
  import { MIGRATION_VERSION } from "../consts.js";
@@ -27,7 +27,7 @@ function printHelp({
27
27
  message.push(
28
28
  linebreak(),
29
29
  ` ${bgGreen(black(` ${commandName} `))} ${green(
30
- `v${"0.14.14"}`
30
+ `v${"0.15.1"}`
31
31
  )} ${headline}`
32
32
  );
33
33
  }
@@ -31,7 +31,7 @@ type VitePluginDBParams = {
31
31
  };
32
32
  export declare function vitePluginDb(params: VitePluginDBParams): VitePlugin;
33
33
  export declare function getConfigVirtualModContents(): string;
34
- export declare function getLocalVirtualModContents({ tables, root, }: {
34
+ export declare function getLocalVirtualModContents({ tables, root }: {
35
35
  tables: DBTables;
36
36
  root: URL;
37
37
  }): string;
@@ -6,7 +6,7 @@ import { createLocalDatabaseClient } from "../../runtime/db-client.js";
6
6
  import { normalizeDatabaseUrl } from "../../runtime/index.js";
7
7
  import { DB_PATH, RUNTIME_IMPORT, RUNTIME_VIRTUAL_IMPORT, VIRTUAL_MODULE_ID } from "../consts.js";
8
8
  import { getResolvedFileUrl } from "../load-file.js";
9
- import { SEED_DEV_FILE_NAME, getCreateIndexQueries, getCreateTableQuery } from "../queries.js";
9
+ import { getCreateIndexQueries, getCreateTableQuery, SEED_DEV_FILE_NAME } from "../queries.js";
10
10
  import {
11
11
  getAstroEnv,
12
12
  getDbDirectoryUrl,
@@ -70,10 +70,7 @@ function vitePluginDb(params) {
70
70
  function getConfigVirtualModContents() {
71
71
  return `export * from ${RUNTIME_VIRTUAL_IMPORT}`;
72
72
  }
73
- function getLocalVirtualModContents({
74
- tables,
75
- root
76
- }) {
73
+ function getLocalVirtualModContents({ tables, root }) {
77
74
  const { ASTRO_DATABASE_FILE } = getAstroEnv();
78
75
  const dbInfo = getRemoteDatabaseInfo();
79
76
  const dbUrl = new URL(DB_PATH, root);
@@ -153,10 +150,7 @@ async function recreateTables({ tables, root }) {
153
150
  ...setupQueries.map((q) => db.run(q))
154
151
  ]);
155
152
  }
156
- function getResolvedSeedFiles({
157
- root,
158
- seedFiles
159
- }) {
153
+ function getResolvedSeedFiles({ root, seedFiles }) {
160
154
  const localSeedFiles = SEED_DEV_FILE_NAME.map((name) => new URL(name, getDbDirectoryUrl(root)));
161
155
  const integrationSeedFiles = seedFiles.get().map((s) => getResolvedFileUrl(root, s));
162
156
  return [...integrationSeedFiles, ...localSeedFiles];
@@ -11,17 +11,16 @@ export declare function resolveDbConfig({ root, integrations, }: Pick<AstroConfi
11
11
  on: string | string[];
12
12
  unique?: boolean | undefined;
13
13
  }>;
14
- deprecated: boolean;
15
14
  columns: Record<string, {
16
15
  type: "boolean";
17
16
  schema: {
18
17
  optional: boolean;
19
18
  unique: boolean;
20
19
  deprecated: boolean;
20
+ default?: boolean | import("../runtime/types.js").SerializedSQL | undefined;
21
21
  name?: string | undefined;
22
22
  label?: string | undefined;
23
23
  collection?: string | undefined;
24
- default?: boolean | import("../runtime/types.js").SerializedSQL | undefined;
25
24
  };
26
25
  } | {
27
26
  type: "number";
@@ -37,8 +36,8 @@ export declare function resolveDbConfig({ root, integrations, }: Pick<AstroConfi
37
36
  default?: number | import("../runtime/types.js").SerializedSQL | undefined;
38
37
  } | {
39
38
  primaryKey: true;
40
- optional?: false | undefined;
41
39
  default?: undefined;
40
+ optional?: false | undefined;
42
41
  })) & {
43
42
  references?: import("./types.js").NumberColumn;
44
43
  };
@@ -47,10 +46,10 @@ export declare function resolveDbConfig({ root, integrations, }: Pick<AstroConfi
47
46
  schema: ({
48
47
  unique: boolean;
49
48
  deprecated: boolean;
49
+ default?: string | import("../runtime/types.js").SerializedSQL | undefined;
50
50
  name?: string | undefined;
51
51
  label?: string | undefined;
52
52
  collection?: string | undefined;
53
- default?: string | import("../runtime/types.js").SerializedSQL | undefined;
54
53
  multiline?: boolean | undefined;
55
54
  } & ({
56
55
  optional: boolean;
@@ -67,10 +66,10 @@ export declare function resolveDbConfig({ root, integrations, }: Pick<AstroConfi
67
66
  optional: boolean;
68
67
  unique: boolean;
69
68
  deprecated: boolean;
69
+ default?: string | import("../runtime/types.js").SerializedSQL | undefined;
70
70
  name?: string | undefined;
71
71
  label?: string | undefined;
72
72
  collection?: string | undefined;
73
- default?: string | import("../runtime/types.js").SerializedSQL | undefined;
74
73
  };
75
74
  } | {
76
75
  type: "json";
@@ -78,12 +77,13 @@ export declare function resolveDbConfig({ root, integrations, }: Pick<AstroConfi
78
77
  optional: boolean;
79
78
  unique: boolean;
80
79
  deprecated: boolean;
80
+ default?: unknown;
81
81
  name?: string | undefined;
82
82
  label?: string | undefined;
83
83
  collection?: string | undefined;
84
- default?: unknown;
85
84
  };
86
85
  }>;
86
+ deprecated: boolean;
87
87
  foreignKeys?: (Omit<{
88
88
  columns: import("./schemas.js").MaybeArray<string>;
89
89
  references: () => import("./schemas.js").MaybeArray<Omit<import("zod").input<typeof import("./schemas.js").referenceableColumnSchema>, "references">>;
@@ -1,4 +1,4 @@
1
- import type { BooleanColumn, ColumnType, DBColumn, DBTable, DateColumn, JsonColumn, NumberColumn, TextColumn } from './types.js';
1
+ import type { BooleanColumn, ColumnType, DateColumn, DBColumn, DBTable, JsonColumn, NumberColumn, TextColumn } from './types.js';
2
2
  export declare const SEED_DEV_FILE_NAME: string[];
3
3
  export declare function getDropTableIfExistsQuery(tableName: string): string;
4
4
  export declare function getCreateTableQuery(tableName: string, table: DBTable): string;
@@ -19,8 +19,8 @@ export declare function getReferencesConfig(column: DBColumn): {
19
19
  default?: number | import("../runtime/types.js").SerializedSQL | undefined;
20
20
  } | {
21
21
  primaryKey: true;
22
- optional?: false | undefined;
23
22
  default?: undefined;
23
+ optional?: false | undefined;
24
24
  })) & {
25
25
  references?: NumberColumn;
26
26
  };
@@ -29,10 +29,10 @@ export declare function getReferencesConfig(column: DBColumn): {
29
29
  schema: ({
30
30
  unique: boolean;
31
31
  deprecated: boolean;
32
+ default?: string | import("../runtime/types.js").SerializedSQL | undefined;
32
33
  name?: string | undefined;
33
34
  label?: string | undefined;
34
35
  collection?: string | undefined;
35
- default?: string | import("../runtime/types.js").SerializedSQL | undefined;
36
36
  multiline?: boolean | undefined;
37
37
  } & ({
38
38
  optional: boolean;