@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.
- package/dist/core/cli/commands/link/index.js +7 -3
- package/dist/core/cli/commands/push/index.js +3 -3
- package/dist/core/cli/migration-queries.d.ts +4 -4
- package/dist/core/cli/migration-queries.js +73 -73
- package/dist/core/cli/migrations.js +15 -7
- package/dist/core/errors.js +7 -3
- package/dist/core/integration/file-url.js +2 -1
- package/dist/core/integration/index.js +106 -57
- package/dist/core/integration/typegen.d.ts +3 -3
- package/dist/core/integration/typegen.js +8 -8
- package/dist/core/integration/vite-plugin-db.d.ts +14 -9
- package/dist/core/integration/vite-plugin-db.js +15 -12
- package/dist/core/integration/vite-plugin-inject-env-ts.d.ts +4 -2
- package/dist/core/integration/vite-plugin-inject-env-ts.js +8 -4
- package/dist/core/queries.d.ts +12 -12
- package/dist/core/queries.js +49 -46
- package/dist/core/types.d.ts +232 -231
- package/dist/core/types.js +56 -55
- package/dist/core/utils.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/runtime/db-client.d.ts +9 -4
- package/dist/runtime/db-client.js +11 -7
- package/dist/runtime/index.d.ts +7 -7
- package/dist/runtime/index.js +27 -29
- package/dist/runtime/types.d.ts +7 -7
- package/package.json +3 -5
- package/components/Renderer.astro +0 -14
- package/components/astro-env.d.ts +0 -1
- package/components/index.ts +0 -2
- package/components/tsconfig.json +0 -7
- package/dist/cli/commands/push/index.d.ts +0 -6
- package/dist/cli/commands/shell/index.d.ts +0 -6
- package/dist/cli/commands/sync/index.d.ts +0 -6
- package/dist/cli/commands/verify/index.d.ts +0 -6
- package/dist/cli/index.d.ts +0 -6
- package/dist/cli/queries.d.ts +0 -18
- package/dist/cli/seed.d.ts +0 -6
- package/dist/cli/sync/admin.d.ts +0 -33
- package/dist/cli/sync/index.d.ts +0 -1
- package/dist/cli/sync/migrate.d.ts +0 -1
- package/dist/cli/sync/queries.d.ts +0 -19
- package/dist/cli/sync/remote-db.d.ts +0 -1
- package/dist/config.d.ts +0 -1374
- package/dist/consts.d.ts +0 -7
- package/dist/core/cli/commands/sync/index.d.ts +0 -6
- package/dist/error-map.d.ts +0 -6
- package/dist/errors.d.ts +0 -3
- package/dist/file-url-integration.d.ts +0 -2
- package/dist/integration.d.ts +0 -2
- package/dist/internal-drizzle.d.ts +0 -1
- package/dist/internal.d.ts +0 -47
- package/dist/load-astro-config.d.ts +0 -6
- package/dist/migrations.d.ts +0 -12
- package/dist/root.d.ts +0 -3
- package/dist/typegen.d.ts +0 -5
- package/dist/types.d.ts +0 -1604
- package/dist/utils-runtime.d.ts +0 -1
- package/dist/utils.d.ts +0 -59
- package/dist/vite-plugin-db.d.ts +0 -19
- package/dist/vite-plugin-inject-env-ts.d.ts +0 -9
package/dist/core/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { SQL } from 'drizzle-orm';
|
|
|
6
6
|
import { type SerializedSQL } from '../runtime/types.js';
|
|
7
7
|
export type MaybePromise<T> = T | Promise<T>;
|
|
8
8
|
export type MaybeArray<T> = T | T[];
|
|
9
|
-
declare const
|
|
9
|
+
declare const booleanColumnSchema: z.ZodObject<{
|
|
10
10
|
type: z.ZodLiteral<"boolean">;
|
|
11
11
|
schema: z.ZodObject<{
|
|
12
12
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -51,7 +51,7 @@ declare const booleanFieldSchema: z.ZodObject<{
|
|
|
51
51
|
default?: boolean | SQL<any> | undefined;
|
|
52
52
|
};
|
|
53
53
|
}>;
|
|
54
|
-
declare const
|
|
54
|
+
declare const numberColumnSchema: z.ZodObject<{
|
|
55
55
|
type: z.ZodLiteral<"number">;
|
|
56
56
|
schema: z.ZodType<({
|
|
57
57
|
unique: boolean;
|
|
@@ -103,7 +103,7 @@ declare const numberFieldSchema: z.ZodObject<{
|
|
|
103
103
|
optional?: false | undefined;
|
|
104
104
|
default?: undefined;
|
|
105
105
|
})) & {
|
|
106
|
-
references?: (() => z.input<typeof
|
|
106
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
107
107
|
}>;
|
|
108
108
|
}, "strip", z.ZodTypeAny, {
|
|
109
109
|
type: "number";
|
|
@@ -184,7 +184,7 @@ declare const numberFieldSchema: z.ZodObject<{
|
|
|
184
184
|
optional?: boolean | undefined;
|
|
185
185
|
default?: number | SQL<any> | undefined;
|
|
186
186
|
} & {
|
|
187
|
-
references?: (() => z.input<typeof
|
|
187
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
188
188
|
}) | ({
|
|
189
189
|
name?: string | undefined;
|
|
190
190
|
label?: string | undefined;
|
|
@@ -195,10 +195,10 @@ declare const numberFieldSchema: z.ZodObject<{
|
|
|
195
195
|
optional?: false | undefined;
|
|
196
196
|
default?: undefined;
|
|
197
197
|
} & {
|
|
198
|
-
references?: (() => z.input<typeof
|
|
198
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
199
199
|
});
|
|
200
200
|
}>;
|
|
201
|
-
declare const
|
|
201
|
+
declare const textColumnSchema: z.ZodObject<{
|
|
202
202
|
type: z.ZodLiteral<"text">;
|
|
203
203
|
schema: z.ZodType<({
|
|
204
204
|
unique: boolean;
|
|
@@ -252,7 +252,7 @@ declare const textFieldSchema: z.ZodObject<{
|
|
|
252
252
|
primaryKey: true;
|
|
253
253
|
optional?: false | undefined;
|
|
254
254
|
})) & {
|
|
255
|
-
references?: (() => z.input<typeof
|
|
255
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
256
256
|
}>;
|
|
257
257
|
}, "strip", z.ZodTypeAny, {
|
|
258
258
|
type: "text";
|
|
@@ -340,7 +340,7 @@ declare const textFieldSchema: z.ZodObject<{
|
|
|
340
340
|
primaryKey?: false | undefined;
|
|
341
341
|
optional?: boolean | undefined;
|
|
342
342
|
} & {
|
|
343
|
-
references?: (() => z.input<typeof
|
|
343
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
344
344
|
}) | ({
|
|
345
345
|
name?: string | undefined;
|
|
346
346
|
label?: string | undefined;
|
|
@@ -352,10 +352,10 @@ declare const textFieldSchema: z.ZodObject<{
|
|
|
352
352
|
primaryKey: true;
|
|
353
353
|
optional?: false | undefined;
|
|
354
354
|
} & {
|
|
355
|
-
references?: (() => z.input<typeof
|
|
355
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
356
356
|
});
|
|
357
357
|
}>;
|
|
358
|
-
declare const
|
|
358
|
+
declare const dateColumnSchema: z.ZodObject<{
|
|
359
359
|
type: z.ZodLiteral<"date">;
|
|
360
360
|
schema: z.ZodObject<{
|
|
361
361
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -400,7 +400,7 @@ declare const dateFieldSchema: z.ZodObject<{
|
|
|
400
400
|
default?: Date | SQL<any> | undefined;
|
|
401
401
|
};
|
|
402
402
|
}>;
|
|
403
|
-
declare const
|
|
403
|
+
declare const jsonColumnSchema: z.ZodObject<{
|
|
404
404
|
type: z.ZodLiteral<"json">;
|
|
405
405
|
schema: z.ZodObject<{
|
|
406
406
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -445,7 +445,7 @@ declare const jsonFieldSchema: z.ZodObject<{
|
|
|
445
445
|
default?: unknown;
|
|
446
446
|
};
|
|
447
447
|
}>;
|
|
448
|
-
export declare const
|
|
448
|
+
export declare const columnSchema: z.ZodUnion<[z.ZodObject<{
|
|
449
449
|
type: z.ZodLiteral<"boolean">;
|
|
450
450
|
schema: z.ZodObject<{
|
|
451
451
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -541,7 +541,7 @@ export declare const fieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
541
541
|
optional?: false | undefined;
|
|
542
542
|
default?: undefined;
|
|
543
543
|
})) & {
|
|
544
|
-
references?: (() => z.input<typeof
|
|
544
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
545
545
|
}>;
|
|
546
546
|
}, "strip", z.ZodTypeAny, {
|
|
547
547
|
type: "number";
|
|
@@ -622,7 +622,7 @@ export declare const fieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
622
622
|
optional?: boolean | undefined;
|
|
623
623
|
default?: number | SQL<any> | undefined;
|
|
624
624
|
} & {
|
|
625
|
-
references?: (() => z.input<typeof
|
|
625
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
626
626
|
}) | ({
|
|
627
627
|
name?: string | undefined;
|
|
628
628
|
label?: string | undefined;
|
|
@@ -633,7 +633,7 @@ export declare const fieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
633
633
|
optional?: false | undefined;
|
|
634
634
|
default?: undefined;
|
|
635
635
|
} & {
|
|
636
|
-
references?: (() => z.input<typeof
|
|
636
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
637
637
|
});
|
|
638
638
|
}>, z.ZodObject<{
|
|
639
639
|
type: z.ZodLiteral<"text">;
|
|
@@ -689,7 +689,7 @@ export declare const fieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
689
689
|
primaryKey: true;
|
|
690
690
|
optional?: false | undefined;
|
|
691
691
|
})) & {
|
|
692
|
-
references?: (() => z.input<typeof
|
|
692
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
693
693
|
}>;
|
|
694
694
|
}, "strip", z.ZodTypeAny, {
|
|
695
695
|
type: "text";
|
|
@@ -777,7 +777,7 @@ export declare const fieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
777
777
|
primaryKey?: false | undefined;
|
|
778
778
|
optional?: boolean | undefined;
|
|
779
779
|
} & {
|
|
780
|
-
references?: (() => z.input<typeof
|
|
780
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
781
781
|
}) | ({
|
|
782
782
|
name?: string | undefined;
|
|
783
783
|
label?: string | undefined;
|
|
@@ -789,7 +789,7 @@ export declare const fieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
789
789
|
primaryKey: true;
|
|
790
790
|
optional?: false | undefined;
|
|
791
791
|
} & {
|
|
792
|
-
references?: (() => z.input<typeof
|
|
792
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
793
793
|
});
|
|
794
794
|
}>, z.ZodObject<{
|
|
795
795
|
type: z.ZodLiteral<"date">;
|
|
@@ -880,7 +880,7 @@ export declare const fieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
880
880
|
default?: unknown;
|
|
881
881
|
};
|
|
882
882
|
}>]>;
|
|
883
|
-
export declare const
|
|
883
|
+
export declare const referenceableColumnSchema: z.ZodUnion<[z.ZodObject<{
|
|
884
884
|
type: z.ZodLiteral<"text">;
|
|
885
885
|
schema: z.ZodType<({
|
|
886
886
|
unique: boolean;
|
|
@@ -934,7 +934,7 @@ export declare const referenceableFieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
934
934
|
primaryKey: true;
|
|
935
935
|
optional?: false | undefined;
|
|
936
936
|
})) & {
|
|
937
|
-
references?: (() => z.input<typeof
|
|
937
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
938
938
|
}>;
|
|
939
939
|
}, "strip", z.ZodTypeAny, {
|
|
940
940
|
type: "text";
|
|
@@ -1022,7 +1022,7 @@ export declare const referenceableFieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1022
1022
|
primaryKey?: false | undefined;
|
|
1023
1023
|
optional?: boolean | undefined;
|
|
1024
1024
|
} & {
|
|
1025
|
-
references?: (() => z.input<typeof
|
|
1025
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1026
1026
|
}) | ({
|
|
1027
1027
|
name?: string | undefined;
|
|
1028
1028
|
label?: string | undefined;
|
|
@@ -1034,7 +1034,7 @@ export declare const referenceableFieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1034
1034
|
primaryKey: true;
|
|
1035
1035
|
optional?: false | undefined;
|
|
1036
1036
|
} & {
|
|
1037
|
-
references?: (() => z.input<typeof
|
|
1037
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1038
1038
|
});
|
|
1039
1039
|
}>, z.ZodObject<{
|
|
1040
1040
|
type: z.ZodLiteral<"number">;
|
|
@@ -1088,7 +1088,7 @@ export declare const referenceableFieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1088
1088
|
optional?: false | undefined;
|
|
1089
1089
|
default?: undefined;
|
|
1090
1090
|
})) & {
|
|
1091
|
-
references?: (() => z.input<typeof
|
|
1091
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1092
1092
|
}>;
|
|
1093
1093
|
}, "strip", z.ZodTypeAny, {
|
|
1094
1094
|
type: "number";
|
|
@@ -1169,7 +1169,7 @@ export declare const referenceableFieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1169
1169
|
optional?: boolean | undefined;
|
|
1170
1170
|
default?: number | SQL<any> | undefined;
|
|
1171
1171
|
} & {
|
|
1172
|
-
references?: (() => z.input<typeof
|
|
1172
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1173
1173
|
}) | ({
|
|
1174
1174
|
name?: string | undefined;
|
|
1175
1175
|
label?: string | undefined;
|
|
@@ -1180,10 +1180,10 @@ export declare const referenceableFieldSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1180
1180
|
optional?: false | undefined;
|
|
1181
1181
|
default?: undefined;
|
|
1182
1182
|
} & {
|
|
1183
|
-
references?: (() => z.input<typeof
|
|
1183
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1184
1184
|
});
|
|
1185
1185
|
}>]>;
|
|
1186
|
-
declare const
|
|
1186
|
+
declare const columnsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
1187
1187
|
type: z.ZodLiteral<"boolean">;
|
|
1188
1188
|
schema: z.ZodObject<{
|
|
1189
1189
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1279,7 +1279,7 @@ declare const fieldsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
|
1279
1279
|
optional?: false | undefined;
|
|
1280
1280
|
default?: undefined;
|
|
1281
1281
|
})) & {
|
|
1282
|
-
references?: (() => z.input<typeof
|
|
1282
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1283
1283
|
}>;
|
|
1284
1284
|
}, "strip", z.ZodTypeAny, {
|
|
1285
1285
|
type: "number";
|
|
@@ -1360,7 +1360,7 @@ declare const fieldsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
|
1360
1360
|
optional?: boolean | undefined;
|
|
1361
1361
|
default?: number | SQL<any> | undefined;
|
|
1362
1362
|
} & {
|
|
1363
|
-
references?: (() => z.input<typeof
|
|
1363
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1364
1364
|
}) | ({
|
|
1365
1365
|
name?: string | undefined;
|
|
1366
1366
|
label?: string | undefined;
|
|
@@ -1371,7 +1371,7 @@ declare const fieldsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
|
1371
1371
|
optional?: false | undefined;
|
|
1372
1372
|
default?: undefined;
|
|
1373
1373
|
} & {
|
|
1374
|
-
references?: (() => z.input<typeof
|
|
1374
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1375
1375
|
});
|
|
1376
1376
|
}>, z.ZodObject<{
|
|
1377
1377
|
type: z.ZodLiteral<"text">;
|
|
@@ -1427,7 +1427,7 @@ declare const fieldsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
|
1427
1427
|
primaryKey: true;
|
|
1428
1428
|
optional?: false | undefined;
|
|
1429
1429
|
})) & {
|
|
1430
|
-
references?: (() => z.input<typeof
|
|
1430
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1431
1431
|
}>;
|
|
1432
1432
|
}, "strip", z.ZodTypeAny, {
|
|
1433
1433
|
type: "text";
|
|
@@ -1515,7 +1515,7 @@ declare const fieldsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
|
1515
1515
|
primaryKey?: false | undefined;
|
|
1516
1516
|
optional?: boolean | undefined;
|
|
1517
1517
|
} & {
|
|
1518
|
-
references?: (() => z.input<typeof
|
|
1518
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1519
1519
|
}) | ({
|
|
1520
1520
|
name?: string | undefined;
|
|
1521
1521
|
label?: string | undefined;
|
|
@@ -1527,7 +1527,7 @@ declare const fieldsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
|
1527
1527
|
primaryKey: true;
|
|
1528
1528
|
optional?: false | undefined;
|
|
1529
1529
|
} & {
|
|
1530
|
-
references?: (() => z.input<typeof
|
|
1530
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1531
1531
|
});
|
|
1532
1532
|
}>, z.ZodObject<{
|
|
1533
1533
|
type: z.ZodLiteral<"date">;
|
|
@@ -1629,15 +1629,15 @@ export declare const indexSchema: z.ZodObject<{
|
|
|
1629
1629
|
unique?: boolean | undefined;
|
|
1630
1630
|
}>;
|
|
1631
1631
|
type ForeignKeysInput = {
|
|
1632
|
-
|
|
1633
|
-
references: () => MaybeArray<Omit<z.input<typeof
|
|
1632
|
+
columns: MaybeArray<string>;
|
|
1633
|
+
references: () => MaybeArray<Omit<z.input<typeof referenceableColumnSchema>, 'references'>>;
|
|
1634
1634
|
};
|
|
1635
1635
|
type ForeignKeysOutput = Omit<ForeignKeysInput, 'references'> & {
|
|
1636
|
-
references: MaybeArray<Omit<z.output<typeof
|
|
1636
|
+
references: MaybeArray<Omit<z.output<typeof referenceableColumnSchema>, 'references'>>;
|
|
1637
1637
|
};
|
|
1638
1638
|
export type Indexes = Record<string, z.infer<typeof indexSchema>>;
|
|
1639
1639
|
export declare const readableCollectionSchema: z.ZodObject<{
|
|
1640
|
-
|
|
1640
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
1641
1641
|
type: z.ZodLiteral<"boolean">;
|
|
1642
1642
|
schema: z.ZodObject<{
|
|
1643
1643
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1733,7 +1733,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
1733
1733
|
optional?: false | undefined;
|
|
1734
1734
|
default?: undefined;
|
|
1735
1735
|
})) & {
|
|
1736
|
-
references?: (() => z.input<typeof
|
|
1736
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1737
1737
|
}>;
|
|
1738
1738
|
}, "strip", z.ZodTypeAny, {
|
|
1739
1739
|
type: "number";
|
|
@@ -1768,7 +1768,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
1768
1768
|
optional?: boolean | undefined;
|
|
1769
1769
|
default?: number | SQL<any> | undefined;
|
|
1770
1770
|
} & {
|
|
1771
|
-
references?: (() => z.input<typeof
|
|
1771
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1772
1772
|
}) | ({
|
|
1773
1773
|
name?: string | undefined;
|
|
1774
1774
|
label?: string | undefined;
|
|
@@ -1779,7 +1779,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
1779
1779
|
optional?: false | undefined;
|
|
1780
1780
|
default?: undefined;
|
|
1781
1781
|
} & {
|
|
1782
|
-
references?: (() => z.input<typeof
|
|
1782
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
1783
1783
|
});
|
|
1784
1784
|
}>, z.ZodObject<{
|
|
1785
1785
|
type: z.ZodLiteral<"text">;
|
|
@@ -1835,7 +1835,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
1835
1835
|
primaryKey: true;
|
|
1836
1836
|
optional?: false | undefined;
|
|
1837
1837
|
})) & {
|
|
1838
|
-
references?: (() => z.input<typeof
|
|
1838
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1839
1839
|
}>;
|
|
1840
1840
|
}, "strip", z.ZodTypeAny, {
|
|
1841
1841
|
type: "text";
|
|
@@ -1873,7 +1873,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
1873
1873
|
primaryKey?: false | undefined;
|
|
1874
1874
|
optional?: boolean | undefined;
|
|
1875
1875
|
} & {
|
|
1876
|
-
references?: (() => z.input<typeof
|
|
1876
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1877
1877
|
}) | ({
|
|
1878
1878
|
name?: string | undefined;
|
|
1879
1879
|
label?: string | undefined;
|
|
@@ -1885,7 +1885,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
1885
1885
|
primaryKey: true;
|
|
1886
1886
|
optional?: false | undefined;
|
|
1887
1887
|
} & {
|
|
1888
|
-
references?: (() => z.input<typeof
|
|
1888
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
1889
1889
|
});
|
|
1890
1890
|
}>, z.ZodObject<{
|
|
1891
1891
|
type: z.ZodLiteral<"date">;
|
|
@@ -1989,7 +1989,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
1989
1989
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
1990
1990
|
writable: z.ZodLiteral<false>;
|
|
1991
1991
|
}, "strip", z.ZodTypeAny, {
|
|
1992
|
-
|
|
1992
|
+
columns: Record<string, {
|
|
1993
1993
|
type: "boolean";
|
|
1994
1994
|
schema: {
|
|
1995
1995
|
optional: boolean;
|
|
@@ -2071,7 +2071,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
2071
2071
|
}> | undefined;
|
|
2072
2072
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
2073
2073
|
}, {
|
|
2074
|
-
|
|
2074
|
+
columns: Record<string, {
|
|
2075
2075
|
type: "boolean";
|
|
2076
2076
|
schema: {
|
|
2077
2077
|
name?: string | undefined;
|
|
@@ -2093,7 +2093,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
2093
2093
|
optional?: boolean | undefined;
|
|
2094
2094
|
default?: number | SQL<any> | undefined;
|
|
2095
2095
|
} & {
|
|
2096
|
-
references?: (() => z.input<typeof
|
|
2096
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2097
2097
|
}) | ({
|
|
2098
2098
|
name?: string | undefined;
|
|
2099
2099
|
label?: string | undefined;
|
|
@@ -2104,7 +2104,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
2104
2104
|
optional?: false | undefined;
|
|
2105
2105
|
default?: undefined;
|
|
2106
2106
|
} & {
|
|
2107
|
-
references?: (() => z.input<typeof
|
|
2107
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2108
2108
|
});
|
|
2109
2109
|
} | {
|
|
2110
2110
|
type: "text";
|
|
@@ -2119,7 +2119,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
2119
2119
|
primaryKey?: false | undefined;
|
|
2120
2120
|
optional?: boolean | undefined;
|
|
2121
2121
|
} & {
|
|
2122
|
-
references?: (() => z.input<typeof
|
|
2122
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2123
2123
|
}) | ({
|
|
2124
2124
|
name?: string | undefined;
|
|
2125
2125
|
label?: string | undefined;
|
|
@@ -2131,7 +2131,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
2131
2131
|
primaryKey: true;
|
|
2132
2132
|
optional?: false | undefined;
|
|
2133
2133
|
} & {
|
|
2134
|
-
references?: (() => z.input<typeof
|
|
2134
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2135
2135
|
});
|
|
2136
2136
|
} | {
|
|
2137
2137
|
type: "date";
|
|
@@ -2162,7 +2162,7 @@ export declare const readableCollectionSchema: z.ZodObject<{
|
|
|
2162
2162
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
2163
2163
|
}>;
|
|
2164
2164
|
export declare const writableCollectionSchema: z.ZodObject<{
|
|
2165
|
-
|
|
2165
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
2166
2166
|
type: z.ZodLiteral<"boolean">;
|
|
2167
2167
|
schema: z.ZodObject<{
|
|
2168
2168
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -2258,7 +2258,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2258
2258
|
optional?: false | undefined;
|
|
2259
2259
|
default?: undefined;
|
|
2260
2260
|
})) & {
|
|
2261
|
-
references?: (() => z.input<typeof
|
|
2261
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2262
2262
|
}>;
|
|
2263
2263
|
}, "strip", z.ZodTypeAny, {
|
|
2264
2264
|
type: "number";
|
|
@@ -2293,7 +2293,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2293
2293
|
optional?: boolean | undefined;
|
|
2294
2294
|
default?: number | SQL<any> | undefined;
|
|
2295
2295
|
} & {
|
|
2296
|
-
references?: (() => z.input<typeof
|
|
2296
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2297
2297
|
}) | ({
|
|
2298
2298
|
name?: string | undefined;
|
|
2299
2299
|
label?: string | undefined;
|
|
@@ -2304,7 +2304,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2304
2304
|
optional?: false | undefined;
|
|
2305
2305
|
default?: undefined;
|
|
2306
2306
|
} & {
|
|
2307
|
-
references?: (() => z.input<typeof
|
|
2307
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2308
2308
|
});
|
|
2309
2309
|
}>, z.ZodObject<{
|
|
2310
2310
|
type: z.ZodLiteral<"text">;
|
|
@@ -2360,7 +2360,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2360
2360
|
primaryKey: true;
|
|
2361
2361
|
optional?: false | undefined;
|
|
2362
2362
|
})) & {
|
|
2363
|
-
references?: (() => z.input<typeof
|
|
2363
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2364
2364
|
}>;
|
|
2365
2365
|
}, "strip", z.ZodTypeAny, {
|
|
2366
2366
|
type: "text";
|
|
@@ -2398,7 +2398,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2398
2398
|
primaryKey?: false | undefined;
|
|
2399
2399
|
optional?: boolean | undefined;
|
|
2400
2400
|
} & {
|
|
2401
|
-
references?: (() => z.input<typeof
|
|
2401
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2402
2402
|
}) | ({
|
|
2403
2403
|
name?: string | undefined;
|
|
2404
2404
|
label?: string | undefined;
|
|
@@ -2410,7 +2410,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2410
2410
|
primaryKey: true;
|
|
2411
2411
|
optional?: false | undefined;
|
|
2412
2412
|
} & {
|
|
2413
|
-
references?: (() => z.input<typeof
|
|
2413
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2414
2414
|
});
|
|
2415
2415
|
}>, z.ZodObject<{
|
|
2416
2416
|
type: z.ZodLiteral<"date">;
|
|
@@ -2514,7 +2514,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2514
2514
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
2515
2515
|
writable: z.ZodLiteral<true>;
|
|
2516
2516
|
}, "strip", z.ZodTypeAny, {
|
|
2517
|
-
|
|
2517
|
+
columns: Record<string, {
|
|
2518
2518
|
type: "boolean";
|
|
2519
2519
|
schema: {
|
|
2520
2520
|
optional: boolean;
|
|
@@ -2596,7 +2596,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2596
2596
|
}> | undefined;
|
|
2597
2597
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
2598
2598
|
}, {
|
|
2599
|
-
|
|
2599
|
+
columns: Record<string, {
|
|
2600
2600
|
type: "boolean";
|
|
2601
2601
|
schema: {
|
|
2602
2602
|
name?: string | undefined;
|
|
@@ -2618,7 +2618,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2618
2618
|
optional?: boolean | undefined;
|
|
2619
2619
|
default?: number | SQL<any> | undefined;
|
|
2620
2620
|
} & {
|
|
2621
|
-
references?: (() => z.input<typeof
|
|
2621
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2622
2622
|
}) | ({
|
|
2623
2623
|
name?: string | undefined;
|
|
2624
2624
|
label?: string | undefined;
|
|
@@ -2629,7 +2629,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2629
2629
|
optional?: false | undefined;
|
|
2630
2630
|
default?: undefined;
|
|
2631
2631
|
} & {
|
|
2632
|
-
references?: (() => z.input<typeof
|
|
2632
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2633
2633
|
});
|
|
2634
2634
|
} | {
|
|
2635
2635
|
type: "text";
|
|
@@ -2644,7 +2644,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2644
2644
|
primaryKey?: false | undefined;
|
|
2645
2645
|
optional?: boolean | undefined;
|
|
2646
2646
|
} & {
|
|
2647
|
-
references?: (() => z.input<typeof
|
|
2647
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2648
2648
|
}) | ({
|
|
2649
2649
|
name?: string | undefined;
|
|
2650
2650
|
label?: string | undefined;
|
|
@@ -2656,7 +2656,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2656
2656
|
primaryKey: true;
|
|
2657
2657
|
optional?: false | undefined;
|
|
2658
2658
|
} & {
|
|
2659
|
-
references?: (() => z.input<typeof
|
|
2659
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2660
2660
|
});
|
|
2661
2661
|
} | {
|
|
2662
2662
|
type: "date";
|
|
@@ -2687,7 +2687,7 @@ export declare const writableCollectionSchema: z.ZodObject<{
|
|
|
2687
2687
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
2688
2688
|
}>;
|
|
2689
2689
|
export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
2690
|
-
|
|
2690
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
2691
2691
|
type: z.ZodLiteral<"boolean">;
|
|
2692
2692
|
schema: z.ZodObject<{
|
|
2693
2693
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -2783,7 +2783,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2783
2783
|
optional?: false | undefined;
|
|
2784
2784
|
default?: undefined;
|
|
2785
2785
|
})) & {
|
|
2786
|
-
references?: (() => z.input<typeof
|
|
2786
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2787
2787
|
}>;
|
|
2788
2788
|
}, "strip", z.ZodTypeAny, {
|
|
2789
2789
|
type: "number";
|
|
@@ -2818,7 +2818,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2818
2818
|
optional?: boolean | undefined;
|
|
2819
2819
|
default?: number | SQL<any> | undefined;
|
|
2820
2820
|
} & {
|
|
2821
|
-
references?: (() => z.input<typeof
|
|
2821
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2822
2822
|
}) | ({
|
|
2823
2823
|
name?: string | undefined;
|
|
2824
2824
|
label?: string | undefined;
|
|
@@ -2829,7 +2829,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2829
2829
|
optional?: false | undefined;
|
|
2830
2830
|
default?: undefined;
|
|
2831
2831
|
} & {
|
|
2832
|
-
references?: (() => z.input<typeof
|
|
2832
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
2833
2833
|
});
|
|
2834
2834
|
}>, z.ZodObject<{
|
|
2835
2835
|
type: z.ZodLiteral<"text">;
|
|
@@ -2885,7 +2885,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2885
2885
|
primaryKey: true;
|
|
2886
2886
|
optional?: false | undefined;
|
|
2887
2887
|
})) & {
|
|
2888
|
-
references?: (() => z.input<typeof
|
|
2888
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2889
2889
|
}>;
|
|
2890
2890
|
}, "strip", z.ZodTypeAny, {
|
|
2891
2891
|
type: "text";
|
|
@@ -2923,7 +2923,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2923
2923
|
primaryKey?: false | undefined;
|
|
2924
2924
|
optional?: boolean | undefined;
|
|
2925
2925
|
} & {
|
|
2926
|
-
references?: (() => z.input<typeof
|
|
2926
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2927
2927
|
}) | ({
|
|
2928
2928
|
name?: string | undefined;
|
|
2929
2929
|
label?: string | undefined;
|
|
@@ -2935,7 +2935,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2935
2935
|
primaryKey: true;
|
|
2936
2936
|
optional?: false | undefined;
|
|
2937
2937
|
} & {
|
|
2938
|
-
references?: (() => z.input<typeof
|
|
2938
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
2939
2939
|
});
|
|
2940
2940
|
}>, z.ZodObject<{
|
|
2941
2941
|
type: z.ZodLiteral<"date">;
|
|
@@ -3039,7 +3039,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3039
3039
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
3040
3040
|
writable: z.ZodLiteral<false>;
|
|
3041
3041
|
}, "strip", z.ZodTypeAny, {
|
|
3042
|
-
|
|
3042
|
+
columns: Record<string, {
|
|
3043
3043
|
type: "boolean";
|
|
3044
3044
|
schema: {
|
|
3045
3045
|
optional: boolean;
|
|
@@ -3121,7 +3121,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3121
3121
|
}> | undefined;
|
|
3122
3122
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
3123
3123
|
}, {
|
|
3124
|
-
|
|
3124
|
+
columns: Record<string, {
|
|
3125
3125
|
type: "boolean";
|
|
3126
3126
|
schema: {
|
|
3127
3127
|
name?: string | undefined;
|
|
@@ -3143,7 +3143,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3143
3143
|
optional?: boolean | undefined;
|
|
3144
3144
|
default?: number | SQL<any> | undefined;
|
|
3145
3145
|
} & {
|
|
3146
|
-
references?: (() => z.input<typeof
|
|
3146
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3147
3147
|
}) | ({
|
|
3148
3148
|
name?: string | undefined;
|
|
3149
3149
|
label?: string | undefined;
|
|
@@ -3154,7 +3154,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3154
3154
|
optional?: false | undefined;
|
|
3155
3155
|
default?: undefined;
|
|
3156
3156
|
} & {
|
|
3157
|
-
references?: (() => z.input<typeof
|
|
3157
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3158
3158
|
});
|
|
3159
3159
|
} | {
|
|
3160
3160
|
type: "text";
|
|
@@ -3169,7 +3169,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3169
3169
|
primaryKey?: false | undefined;
|
|
3170
3170
|
optional?: boolean | undefined;
|
|
3171
3171
|
} & {
|
|
3172
|
-
references?: (() => z.input<typeof
|
|
3172
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3173
3173
|
}) | ({
|
|
3174
3174
|
name?: string | undefined;
|
|
3175
3175
|
label?: string | undefined;
|
|
@@ -3181,7 +3181,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3181
3181
|
primaryKey: true;
|
|
3182
3182
|
optional?: false | undefined;
|
|
3183
3183
|
} & {
|
|
3184
|
-
references?: (() => z.input<typeof
|
|
3184
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3185
3185
|
});
|
|
3186
3186
|
} | {
|
|
3187
3187
|
type: "date";
|
|
@@ -3211,7 +3211,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3211
3211
|
}> | undefined;
|
|
3212
3212
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
3213
3213
|
}>, z.ZodObject<{
|
|
3214
|
-
|
|
3214
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
3215
3215
|
type: z.ZodLiteral<"boolean">;
|
|
3216
3216
|
schema: z.ZodObject<{
|
|
3217
3217
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -3307,7 +3307,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3307
3307
|
optional?: false | undefined;
|
|
3308
3308
|
default?: undefined;
|
|
3309
3309
|
})) & {
|
|
3310
|
-
references?: (() => z.input<typeof
|
|
3310
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3311
3311
|
}>;
|
|
3312
3312
|
}, "strip", z.ZodTypeAny, {
|
|
3313
3313
|
type: "number";
|
|
@@ -3342,7 +3342,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3342
3342
|
optional?: boolean | undefined;
|
|
3343
3343
|
default?: number | SQL<any> | undefined;
|
|
3344
3344
|
} & {
|
|
3345
|
-
references?: (() => z.input<typeof
|
|
3345
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3346
3346
|
}) | ({
|
|
3347
3347
|
name?: string | undefined;
|
|
3348
3348
|
label?: string | undefined;
|
|
@@ -3353,7 +3353,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3353
3353
|
optional?: false | undefined;
|
|
3354
3354
|
default?: undefined;
|
|
3355
3355
|
} & {
|
|
3356
|
-
references?: (() => z.input<typeof
|
|
3356
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3357
3357
|
});
|
|
3358
3358
|
}>, z.ZodObject<{
|
|
3359
3359
|
type: z.ZodLiteral<"text">;
|
|
@@ -3409,7 +3409,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3409
3409
|
primaryKey: true;
|
|
3410
3410
|
optional?: false | undefined;
|
|
3411
3411
|
})) & {
|
|
3412
|
-
references?: (() => z.input<typeof
|
|
3412
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3413
3413
|
}>;
|
|
3414
3414
|
}, "strip", z.ZodTypeAny, {
|
|
3415
3415
|
type: "text";
|
|
@@ -3447,7 +3447,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3447
3447
|
primaryKey?: false | undefined;
|
|
3448
3448
|
optional?: boolean | undefined;
|
|
3449
3449
|
} & {
|
|
3450
|
-
references?: (() => z.input<typeof
|
|
3450
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3451
3451
|
}) | ({
|
|
3452
3452
|
name?: string | undefined;
|
|
3453
3453
|
label?: string | undefined;
|
|
@@ -3459,7 +3459,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3459
3459
|
primaryKey: true;
|
|
3460
3460
|
optional?: false | undefined;
|
|
3461
3461
|
} & {
|
|
3462
|
-
references?: (() => z.input<typeof
|
|
3462
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3463
3463
|
});
|
|
3464
3464
|
}>, z.ZodObject<{
|
|
3465
3465
|
type: z.ZodLiteral<"date">;
|
|
@@ -3563,7 +3563,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3563
3563
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
3564
3564
|
writable: z.ZodLiteral<true>;
|
|
3565
3565
|
}, "strip", z.ZodTypeAny, {
|
|
3566
|
-
|
|
3566
|
+
columns: Record<string, {
|
|
3567
3567
|
type: "boolean";
|
|
3568
3568
|
schema: {
|
|
3569
3569
|
optional: boolean;
|
|
@@ -3645,7 +3645,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3645
3645
|
}> | undefined;
|
|
3646
3646
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
3647
3647
|
}, {
|
|
3648
|
-
|
|
3648
|
+
columns: Record<string, {
|
|
3649
3649
|
type: "boolean";
|
|
3650
3650
|
schema: {
|
|
3651
3651
|
name?: string | undefined;
|
|
@@ -3667,7 +3667,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3667
3667
|
optional?: boolean | undefined;
|
|
3668
3668
|
default?: number | SQL<any> | undefined;
|
|
3669
3669
|
} & {
|
|
3670
|
-
references?: (() => z.input<typeof
|
|
3670
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3671
3671
|
}) | ({
|
|
3672
3672
|
name?: string | undefined;
|
|
3673
3673
|
label?: string | undefined;
|
|
@@ -3678,7 +3678,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3678
3678
|
optional?: false | undefined;
|
|
3679
3679
|
default?: undefined;
|
|
3680
3680
|
} & {
|
|
3681
|
-
references?: (() => z.input<typeof
|
|
3681
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3682
3682
|
});
|
|
3683
3683
|
} | {
|
|
3684
3684
|
type: "text";
|
|
@@ -3693,7 +3693,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3693
3693
|
primaryKey?: false | undefined;
|
|
3694
3694
|
optional?: boolean | undefined;
|
|
3695
3695
|
} & {
|
|
3696
|
-
references?: (() => z.input<typeof
|
|
3696
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3697
3697
|
}) | ({
|
|
3698
3698
|
name?: string | undefined;
|
|
3699
3699
|
label?: string | undefined;
|
|
@@ -3705,7 +3705,7 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3705
3705
|
primaryKey: true;
|
|
3706
3706
|
optional?: false | undefined;
|
|
3707
3707
|
} & {
|
|
3708
|
-
references?: (() => z.input<typeof
|
|
3708
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3709
3709
|
});
|
|
3710
3710
|
} | {
|
|
3711
3711
|
type: "date";
|
|
@@ -3735,8 +3735,8 @@ export declare const collectionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
3735
3735
|
}> | undefined;
|
|
3736
3736
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
3737
3737
|
}>]>;
|
|
3738
|
-
export declare const
|
|
3739
|
-
|
|
3738
|
+
export declare const tablesSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
3739
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
3740
3740
|
type: z.ZodLiteral<"boolean">;
|
|
3741
3741
|
schema: z.ZodObject<{
|
|
3742
3742
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -3832,7 +3832,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
3832
3832
|
optional?: false | undefined;
|
|
3833
3833
|
default?: undefined;
|
|
3834
3834
|
})) & {
|
|
3835
|
-
references?: (() => z.input<typeof
|
|
3835
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3836
3836
|
}>;
|
|
3837
3837
|
}, "strip", z.ZodTypeAny, {
|
|
3838
3838
|
type: "number";
|
|
@@ -3867,7 +3867,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
3867
3867
|
optional?: boolean | undefined;
|
|
3868
3868
|
default?: number | SQL<any> | undefined;
|
|
3869
3869
|
} & {
|
|
3870
|
-
references?: (() => z.input<typeof
|
|
3870
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3871
3871
|
}) | ({
|
|
3872
3872
|
name?: string | undefined;
|
|
3873
3873
|
label?: string | undefined;
|
|
@@ -3878,7 +3878,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
3878
3878
|
optional?: false | undefined;
|
|
3879
3879
|
default?: undefined;
|
|
3880
3880
|
} & {
|
|
3881
|
-
references?: (() => z.input<typeof
|
|
3881
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
3882
3882
|
});
|
|
3883
3883
|
}>, z.ZodObject<{
|
|
3884
3884
|
type: z.ZodLiteral<"text">;
|
|
@@ -3934,7 +3934,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
3934
3934
|
primaryKey: true;
|
|
3935
3935
|
optional?: false | undefined;
|
|
3936
3936
|
})) & {
|
|
3937
|
-
references?: (() => z.input<typeof
|
|
3937
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3938
3938
|
}>;
|
|
3939
3939
|
}, "strip", z.ZodTypeAny, {
|
|
3940
3940
|
type: "text";
|
|
@@ -3972,7 +3972,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
3972
3972
|
primaryKey?: false | undefined;
|
|
3973
3973
|
optional?: boolean | undefined;
|
|
3974
3974
|
} & {
|
|
3975
|
-
references?: (() => z.input<typeof
|
|
3975
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3976
3976
|
}) | ({
|
|
3977
3977
|
name?: string | undefined;
|
|
3978
3978
|
label?: string | undefined;
|
|
@@ -3984,7 +3984,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
3984
3984
|
primaryKey: true;
|
|
3985
3985
|
optional?: false | undefined;
|
|
3986
3986
|
} & {
|
|
3987
|
-
references?: (() => z.input<typeof
|
|
3987
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
3988
3988
|
});
|
|
3989
3989
|
}>, z.ZodObject<{
|
|
3990
3990
|
type: z.ZodLiteral<"date">;
|
|
@@ -4088,7 +4088,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4088
4088
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
4089
4089
|
writable: z.ZodLiteral<false>;
|
|
4090
4090
|
}, "strip", z.ZodTypeAny, {
|
|
4091
|
-
|
|
4091
|
+
columns: Record<string, {
|
|
4092
4092
|
type: "boolean";
|
|
4093
4093
|
schema: {
|
|
4094
4094
|
optional: boolean;
|
|
@@ -4170,7 +4170,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4170
4170
|
}> | undefined;
|
|
4171
4171
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
4172
4172
|
}, {
|
|
4173
|
-
|
|
4173
|
+
columns: Record<string, {
|
|
4174
4174
|
type: "boolean";
|
|
4175
4175
|
schema: {
|
|
4176
4176
|
name?: string | undefined;
|
|
@@ -4192,7 +4192,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4192
4192
|
optional?: boolean | undefined;
|
|
4193
4193
|
default?: number | SQL<any> | undefined;
|
|
4194
4194
|
} & {
|
|
4195
|
-
references?: (() => z.input<typeof
|
|
4195
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
4196
4196
|
}) | ({
|
|
4197
4197
|
name?: string | undefined;
|
|
4198
4198
|
label?: string | undefined;
|
|
@@ -4203,7 +4203,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4203
4203
|
optional?: false | undefined;
|
|
4204
4204
|
default?: undefined;
|
|
4205
4205
|
} & {
|
|
4206
|
-
references?: (() => z.input<typeof
|
|
4206
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
4207
4207
|
});
|
|
4208
4208
|
} | {
|
|
4209
4209
|
type: "text";
|
|
@@ -4218,7 +4218,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4218
4218
|
primaryKey?: false | undefined;
|
|
4219
4219
|
optional?: boolean | undefined;
|
|
4220
4220
|
} & {
|
|
4221
|
-
references?: (() => z.input<typeof
|
|
4221
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
4222
4222
|
}) | ({
|
|
4223
4223
|
name?: string | undefined;
|
|
4224
4224
|
label?: string | undefined;
|
|
@@ -4230,7 +4230,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4230
4230
|
primaryKey: true;
|
|
4231
4231
|
optional?: false | undefined;
|
|
4232
4232
|
} & {
|
|
4233
|
-
references?: (() => z.input<typeof
|
|
4233
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
4234
4234
|
});
|
|
4235
4235
|
} | {
|
|
4236
4236
|
type: "date";
|
|
@@ -4260,7 +4260,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4260
4260
|
}> | undefined;
|
|
4261
4261
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
4262
4262
|
}>, z.ZodObject<{
|
|
4263
|
-
|
|
4263
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
4264
4264
|
type: z.ZodLiteral<"boolean">;
|
|
4265
4265
|
schema: z.ZodObject<{
|
|
4266
4266
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -4356,7 +4356,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4356
4356
|
optional?: false | undefined;
|
|
4357
4357
|
default?: undefined;
|
|
4358
4358
|
})) & {
|
|
4359
|
-
references?: (() => z.input<typeof
|
|
4359
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
4360
4360
|
}>;
|
|
4361
4361
|
}, "strip", z.ZodTypeAny, {
|
|
4362
4362
|
type: "number";
|
|
@@ -4391,7 +4391,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4391
4391
|
optional?: boolean | undefined;
|
|
4392
4392
|
default?: number | SQL<any> | undefined;
|
|
4393
4393
|
} & {
|
|
4394
|
-
references?: (() => z.input<typeof
|
|
4394
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
4395
4395
|
}) | ({
|
|
4396
4396
|
name?: string | undefined;
|
|
4397
4397
|
label?: string | undefined;
|
|
@@ -4402,7 +4402,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4402
4402
|
optional?: false | undefined;
|
|
4403
4403
|
default?: undefined;
|
|
4404
4404
|
} & {
|
|
4405
|
-
references?: (() => z.input<typeof
|
|
4405
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
4406
4406
|
});
|
|
4407
4407
|
}>, z.ZodObject<{
|
|
4408
4408
|
type: z.ZodLiteral<"text">;
|
|
@@ -4458,7 +4458,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4458
4458
|
primaryKey: true;
|
|
4459
4459
|
optional?: false | undefined;
|
|
4460
4460
|
})) & {
|
|
4461
|
-
references?: (() => z.input<typeof
|
|
4461
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
4462
4462
|
}>;
|
|
4463
4463
|
}, "strip", z.ZodTypeAny, {
|
|
4464
4464
|
type: "text";
|
|
@@ -4496,7 +4496,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4496
4496
|
primaryKey?: false | undefined;
|
|
4497
4497
|
optional?: boolean | undefined;
|
|
4498
4498
|
} & {
|
|
4499
|
-
references?: (() => z.input<typeof
|
|
4499
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
4500
4500
|
}) | ({
|
|
4501
4501
|
name?: string | undefined;
|
|
4502
4502
|
label?: string | undefined;
|
|
@@ -4508,7 +4508,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4508
4508
|
primaryKey: true;
|
|
4509
4509
|
optional?: false | undefined;
|
|
4510
4510
|
} & {
|
|
4511
|
-
references?: (() => z.input<typeof
|
|
4511
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
4512
4512
|
});
|
|
4513
4513
|
}>, z.ZodObject<{
|
|
4514
4514
|
type: z.ZodLiteral<"date">;
|
|
@@ -4612,7 +4612,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4612
4612
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
4613
4613
|
writable: z.ZodLiteral<true>;
|
|
4614
4614
|
}, "strip", z.ZodTypeAny, {
|
|
4615
|
-
|
|
4615
|
+
columns: Record<string, {
|
|
4616
4616
|
type: "boolean";
|
|
4617
4617
|
schema: {
|
|
4618
4618
|
optional: boolean;
|
|
@@ -4694,7 +4694,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4694
4694
|
}> | undefined;
|
|
4695
4695
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
4696
4696
|
}, {
|
|
4697
|
-
|
|
4697
|
+
columns: Record<string, {
|
|
4698
4698
|
type: "boolean";
|
|
4699
4699
|
schema: {
|
|
4700
4700
|
name?: string | undefined;
|
|
@@ -4716,7 +4716,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4716
4716
|
optional?: boolean | undefined;
|
|
4717
4717
|
default?: number | SQL<any> | undefined;
|
|
4718
4718
|
} & {
|
|
4719
|
-
references?: (() => z.input<typeof
|
|
4719
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
4720
4720
|
}) | ({
|
|
4721
4721
|
name?: string | undefined;
|
|
4722
4722
|
label?: string | undefined;
|
|
@@ -4727,7 +4727,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4727
4727
|
optional?: false | undefined;
|
|
4728
4728
|
default?: undefined;
|
|
4729
4729
|
} & {
|
|
4730
|
-
references?: (() => z.input<typeof
|
|
4730
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
4731
4731
|
});
|
|
4732
4732
|
} | {
|
|
4733
4733
|
type: "text";
|
|
@@ -4742,7 +4742,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4742
4742
|
primaryKey?: false | undefined;
|
|
4743
4743
|
optional?: boolean | undefined;
|
|
4744
4744
|
} & {
|
|
4745
|
-
references?: (() => z.input<typeof
|
|
4745
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
4746
4746
|
}) | ({
|
|
4747
4747
|
name?: string | undefined;
|
|
4748
4748
|
label?: string | undefined;
|
|
@@ -4754,7 +4754,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4754
4754
|
primaryKey: true;
|
|
4755
4755
|
optional?: false | undefined;
|
|
4756
4756
|
} & {
|
|
4757
|
-
references?: (() => z.input<typeof
|
|
4757
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
4758
4758
|
});
|
|
4759
4759
|
} | {
|
|
4760
4760
|
type: "date";
|
|
@@ -4784,7 +4784,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4784
4784
|
}> | undefined;
|
|
4785
4785
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
4786
4786
|
}>]>>, Record<string, {
|
|
4787
|
-
|
|
4787
|
+
columns: Record<string, {
|
|
4788
4788
|
type: "boolean";
|
|
4789
4789
|
schema: {
|
|
4790
4790
|
optional: boolean;
|
|
@@ -4866,7 +4866,7 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4866
4866
|
}> | undefined;
|
|
4867
4867
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
4868
4868
|
} | {
|
|
4869
|
-
|
|
4869
|
+
columns: Record<string, {
|
|
4870
4870
|
type: "boolean";
|
|
4871
4871
|
schema: {
|
|
4872
4872
|
optional: boolean;
|
|
@@ -4948,43 +4948,43 @@ export declare const collectionsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.
|
|
|
4948
4948
|
}> | undefined;
|
|
4949
4949
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
4950
4950
|
}>, unknown>;
|
|
4951
|
-
export type
|
|
4952
|
-
export type
|
|
4953
|
-
export type
|
|
4954
|
-
export type
|
|
4955
|
-
export type
|
|
4956
|
-
export type
|
|
4957
|
-
export type
|
|
4958
|
-
export type
|
|
4959
|
-
export type
|
|
4960
|
-
export type
|
|
4961
|
-
export type
|
|
4962
|
-
export type
|
|
4963
|
-
export type
|
|
4964
|
-
export type
|
|
4965
|
-
export type
|
|
4966
|
-
export type
|
|
4951
|
+
export type BooleanColumn = z.infer<typeof booleanColumnSchema>;
|
|
4952
|
+
export type BooleanColumnInput = z.input<typeof booleanColumnSchema>;
|
|
4953
|
+
export type NumberColumn = z.infer<typeof numberColumnSchema>;
|
|
4954
|
+
export type NumberColumnInput = z.input<typeof numberColumnSchema>;
|
|
4955
|
+
export type TextColumn = z.infer<typeof textColumnSchema>;
|
|
4956
|
+
export type TextColumnInput = z.input<typeof textColumnSchema>;
|
|
4957
|
+
export type DateColumn = z.infer<typeof dateColumnSchema>;
|
|
4958
|
+
export type DateColumnInput = z.input<typeof dateColumnSchema>;
|
|
4959
|
+
export type JsonColumn = z.infer<typeof jsonColumnSchema>;
|
|
4960
|
+
export type JsonColumnInput = z.input<typeof jsonColumnSchema>;
|
|
4961
|
+
export type ColumnType = BooleanColumn['type'] | NumberColumn['type'] | TextColumn['type'] | DateColumn['type'] | JsonColumn['type'];
|
|
4962
|
+
export type DBColumn = z.infer<typeof columnSchema>;
|
|
4963
|
+
export type DBColumnInput = DateColumnInput | BooleanColumnInput | NumberColumnInput | TextColumnInput | JsonColumnInput;
|
|
4964
|
+
export type DBColumns = z.infer<typeof columnsSchema>;
|
|
4965
|
+
export type DBTable = z.infer<typeof readableCollectionSchema | typeof writableCollectionSchema>;
|
|
4966
|
+
export type DBTables = Record<string, DBTable>;
|
|
4967
4967
|
export type DBSnapshot = {
|
|
4968
|
-
schema: Record<string,
|
|
4968
|
+
schema: Record<string, DBTable>;
|
|
4969
4969
|
/**
|
|
4970
4970
|
* Snapshot version. Breaking changes to the snapshot format increment this number.
|
|
4971
4971
|
* @todo Rename to "version" once closer to release.
|
|
4972
4972
|
*/
|
|
4973
4973
|
experimentalVersion: number;
|
|
4974
4974
|
};
|
|
4975
|
-
export type
|
|
4976
|
-
export type
|
|
4975
|
+
export type ReadableDBTable = z.infer<typeof readableCollectionSchema>;
|
|
4976
|
+
export type WritableDBTable = z.infer<typeof writableCollectionSchema>;
|
|
4977
4977
|
export type DBDataContext = {
|
|
4978
4978
|
db: SqliteDB;
|
|
4979
|
-
seed: <
|
|
4980
|
-
seedReturning: <
|
|
4979
|
+
seed: <TColumns extends ColumnsConfig>(collection: ResolvedCollectionConfig<TColumns>, data: MaybeArray<SQLiteInsertValue<Table<string, TColumns>>>) => Promise<void>;
|
|
4980
|
+
seedReturning: <TColumns extends ColumnsConfig, TData extends MaybeArray<SQLiteInsertValue<Table<string, TColumns>>>>(collection: ResolvedCollectionConfig<TColumns>, data: TData) => Promise<TData extends Array<SQLiteInsertValue<Table<string, TColumns>>> ? InferSelectModel<Table<string, TColumns>>[] : InferSelectModel<Table<string, TColumns>>>;
|
|
4981
4981
|
mode: 'dev' | 'build';
|
|
4982
4982
|
};
|
|
4983
4983
|
export declare function defineData(fn: (ctx: DBDataContext) => MaybePromise<void>): (ctx: DBDataContext) => MaybePromise<void>;
|
|
4984
4984
|
export declare const dbConfigSchema: z.ZodObject<{
|
|
4985
4985
|
studio: z.ZodOptional<z.ZodBoolean>;
|
|
4986
|
-
|
|
4987
|
-
|
|
4986
|
+
tables: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
4987
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
4988
4988
|
type: z.ZodLiteral<"boolean">;
|
|
4989
4989
|
schema: z.ZodObject<{
|
|
4990
4990
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -5080,7 +5080,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5080
5080
|
optional?: false | undefined;
|
|
5081
5081
|
default?: undefined;
|
|
5082
5082
|
})) & {
|
|
5083
|
-
references?: (() => z.input<typeof
|
|
5083
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5084
5084
|
}>;
|
|
5085
5085
|
}, "strip", z.ZodTypeAny, {
|
|
5086
5086
|
type: "number";
|
|
@@ -5115,7 +5115,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5115
5115
|
optional?: boolean | undefined;
|
|
5116
5116
|
default?: number | SQL<any> | undefined;
|
|
5117
5117
|
} & {
|
|
5118
|
-
references?: (() => z.input<typeof
|
|
5118
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5119
5119
|
}) | ({
|
|
5120
5120
|
name?: string | undefined;
|
|
5121
5121
|
label?: string | undefined;
|
|
@@ -5126,7 +5126,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5126
5126
|
optional?: false | undefined;
|
|
5127
5127
|
default?: undefined;
|
|
5128
5128
|
} & {
|
|
5129
|
-
references?: (() => z.input<typeof
|
|
5129
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5130
5130
|
});
|
|
5131
5131
|
}>, z.ZodObject<{
|
|
5132
5132
|
type: z.ZodLiteral<"text">;
|
|
@@ -5182,7 +5182,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5182
5182
|
primaryKey: true;
|
|
5183
5183
|
optional?: false | undefined;
|
|
5184
5184
|
})) & {
|
|
5185
|
-
references?: (() => z.input<typeof
|
|
5185
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5186
5186
|
}>;
|
|
5187
5187
|
}, "strip", z.ZodTypeAny, {
|
|
5188
5188
|
type: "text";
|
|
@@ -5220,7 +5220,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5220
5220
|
primaryKey?: false | undefined;
|
|
5221
5221
|
optional?: boolean | undefined;
|
|
5222
5222
|
} & {
|
|
5223
|
-
references?: (() => z.input<typeof
|
|
5223
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5224
5224
|
}) | ({
|
|
5225
5225
|
name?: string | undefined;
|
|
5226
5226
|
label?: string | undefined;
|
|
@@ -5232,7 +5232,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5232
5232
|
primaryKey: true;
|
|
5233
5233
|
optional?: false | undefined;
|
|
5234
5234
|
} & {
|
|
5235
|
-
references?: (() => z.input<typeof
|
|
5235
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5236
5236
|
});
|
|
5237
5237
|
}>, z.ZodObject<{
|
|
5238
5238
|
type: z.ZodLiteral<"date">;
|
|
@@ -5336,7 +5336,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5336
5336
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
5337
5337
|
writable: z.ZodLiteral<false>;
|
|
5338
5338
|
}, "strip", z.ZodTypeAny, {
|
|
5339
|
-
|
|
5339
|
+
columns: Record<string, {
|
|
5340
5340
|
type: "boolean";
|
|
5341
5341
|
schema: {
|
|
5342
5342
|
optional: boolean;
|
|
@@ -5418,7 +5418,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5418
5418
|
}> | undefined;
|
|
5419
5419
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
5420
5420
|
}, {
|
|
5421
|
-
|
|
5421
|
+
columns: Record<string, {
|
|
5422
5422
|
type: "boolean";
|
|
5423
5423
|
schema: {
|
|
5424
5424
|
name?: string | undefined;
|
|
@@ -5440,7 +5440,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5440
5440
|
optional?: boolean | undefined;
|
|
5441
5441
|
default?: number | SQL<any> | undefined;
|
|
5442
5442
|
} & {
|
|
5443
|
-
references?: (() => z.input<typeof
|
|
5443
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5444
5444
|
}) | ({
|
|
5445
5445
|
name?: string | undefined;
|
|
5446
5446
|
label?: string | undefined;
|
|
@@ -5451,7 +5451,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5451
5451
|
optional?: false | undefined;
|
|
5452
5452
|
default?: undefined;
|
|
5453
5453
|
} & {
|
|
5454
|
-
references?: (() => z.input<typeof
|
|
5454
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5455
5455
|
});
|
|
5456
5456
|
} | {
|
|
5457
5457
|
type: "text";
|
|
@@ -5466,7 +5466,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5466
5466
|
primaryKey?: false | undefined;
|
|
5467
5467
|
optional?: boolean | undefined;
|
|
5468
5468
|
} & {
|
|
5469
|
-
references?: (() => z.input<typeof
|
|
5469
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5470
5470
|
}) | ({
|
|
5471
5471
|
name?: string | undefined;
|
|
5472
5472
|
label?: string | undefined;
|
|
@@ -5478,7 +5478,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5478
5478
|
primaryKey: true;
|
|
5479
5479
|
optional?: false | undefined;
|
|
5480
5480
|
} & {
|
|
5481
|
-
references?: (() => z.input<typeof
|
|
5481
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5482
5482
|
});
|
|
5483
5483
|
} | {
|
|
5484
5484
|
type: "date";
|
|
@@ -5508,7 +5508,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5508
5508
|
}> | undefined;
|
|
5509
5509
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
5510
5510
|
}>, z.ZodObject<{
|
|
5511
|
-
|
|
5511
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
5512
5512
|
type: z.ZodLiteral<"boolean">;
|
|
5513
5513
|
schema: z.ZodObject<{
|
|
5514
5514
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -5604,7 +5604,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5604
5604
|
optional?: false | undefined;
|
|
5605
5605
|
default?: undefined;
|
|
5606
5606
|
})) & {
|
|
5607
|
-
references?: (() => z.input<typeof
|
|
5607
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5608
5608
|
}>;
|
|
5609
5609
|
}, "strip", z.ZodTypeAny, {
|
|
5610
5610
|
type: "number";
|
|
@@ -5639,7 +5639,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5639
5639
|
optional?: boolean | undefined;
|
|
5640
5640
|
default?: number | SQL<any> | undefined;
|
|
5641
5641
|
} & {
|
|
5642
|
-
references?: (() => z.input<typeof
|
|
5642
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5643
5643
|
}) | ({
|
|
5644
5644
|
name?: string | undefined;
|
|
5645
5645
|
label?: string | undefined;
|
|
@@ -5650,7 +5650,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5650
5650
|
optional?: false | undefined;
|
|
5651
5651
|
default?: undefined;
|
|
5652
5652
|
} & {
|
|
5653
|
-
references?: (() => z.input<typeof
|
|
5653
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5654
5654
|
});
|
|
5655
5655
|
}>, z.ZodObject<{
|
|
5656
5656
|
type: z.ZodLiteral<"text">;
|
|
@@ -5706,7 +5706,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5706
5706
|
primaryKey: true;
|
|
5707
5707
|
optional?: false | undefined;
|
|
5708
5708
|
})) & {
|
|
5709
|
-
references?: (() => z.input<typeof
|
|
5709
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5710
5710
|
}>;
|
|
5711
5711
|
}, "strip", z.ZodTypeAny, {
|
|
5712
5712
|
type: "text";
|
|
@@ -5744,7 +5744,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5744
5744
|
primaryKey?: false | undefined;
|
|
5745
5745
|
optional?: boolean | undefined;
|
|
5746
5746
|
} & {
|
|
5747
|
-
references?: (() => z.input<typeof
|
|
5747
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5748
5748
|
}) | ({
|
|
5749
5749
|
name?: string | undefined;
|
|
5750
5750
|
label?: string | undefined;
|
|
@@ -5756,7 +5756,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5756
5756
|
primaryKey: true;
|
|
5757
5757
|
optional?: false | undefined;
|
|
5758
5758
|
} & {
|
|
5759
|
-
references?: (() => z.input<typeof
|
|
5759
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5760
5760
|
});
|
|
5761
5761
|
}>, z.ZodObject<{
|
|
5762
5762
|
type: z.ZodLiteral<"date">;
|
|
@@ -5860,7 +5860,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5860
5860
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
5861
5861
|
writable: z.ZodLiteral<true>;
|
|
5862
5862
|
}, "strip", z.ZodTypeAny, {
|
|
5863
|
-
|
|
5863
|
+
columns: Record<string, {
|
|
5864
5864
|
type: "boolean";
|
|
5865
5865
|
schema: {
|
|
5866
5866
|
optional: boolean;
|
|
@@ -5942,7 +5942,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5942
5942
|
}> | undefined;
|
|
5943
5943
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
5944
5944
|
}, {
|
|
5945
|
-
|
|
5945
|
+
columns: Record<string, {
|
|
5946
5946
|
type: "boolean";
|
|
5947
5947
|
schema: {
|
|
5948
5948
|
name?: string | undefined;
|
|
@@ -5964,7 +5964,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5964
5964
|
optional?: boolean | undefined;
|
|
5965
5965
|
default?: number | SQL<any> | undefined;
|
|
5966
5966
|
} & {
|
|
5967
|
-
references?: (() => z.input<typeof
|
|
5967
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5968
5968
|
}) | ({
|
|
5969
5969
|
name?: string | undefined;
|
|
5970
5970
|
label?: string | undefined;
|
|
@@ -5975,7 +5975,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5975
5975
|
optional?: false | undefined;
|
|
5976
5976
|
default?: undefined;
|
|
5977
5977
|
} & {
|
|
5978
|
-
references?: (() => z.input<typeof
|
|
5978
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
5979
5979
|
});
|
|
5980
5980
|
} | {
|
|
5981
5981
|
type: "text";
|
|
@@ -5990,7 +5990,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
5990
5990
|
primaryKey?: false | undefined;
|
|
5991
5991
|
optional?: boolean | undefined;
|
|
5992
5992
|
} & {
|
|
5993
|
-
references?: (() => z.input<typeof
|
|
5993
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
5994
5994
|
}) | ({
|
|
5995
5995
|
name?: string | undefined;
|
|
5996
5996
|
label?: string | undefined;
|
|
@@ -6002,7 +6002,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
6002
6002
|
primaryKey: true;
|
|
6003
6003
|
optional?: false | undefined;
|
|
6004
6004
|
} & {
|
|
6005
|
-
references?: (() => z.input<typeof
|
|
6005
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
6006
6006
|
});
|
|
6007
6007
|
} | {
|
|
6008
6008
|
type: "date";
|
|
@@ -6032,7 +6032,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
6032
6032
|
}> | undefined;
|
|
6033
6033
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
6034
6034
|
}>]>>, Record<string, {
|
|
6035
|
-
|
|
6035
|
+
columns: Record<string, {
|
|
6036
6036
|
type: "boolean";
|
|
6037
6037
|
schema: {
|
|
6038
6038
|
optional: boolean;
|
|
@@ -6114,7 +6114,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
6114
6114
|
}> | undefined;
|
|
6115
6115
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
6116
6116
|
} | {
|
|
6117
|
-
|
|
6117
|
+
columns: Record<string, {
|
|
6118
6118
|
type: "boolean";
|
|
6119
6119
|
schema: {
|
|
6120
6120
|
optional: boolean;
|
|
@@ -6196,13 +6196,13 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
6196
6196
|
}> | undefined;
|
|
6197
6197
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
6198
6198
|
}>, unknown>>;
|
|
6199
|
-
data: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]
|
|
6199
|
+
data: z.ZodOptional<z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.ZodArray<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, "many">]>>;
|
|
6200
6200
|
unsafeWritable: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
6201
6201
|
}, "strip", z.ZodTypeAny, {
|
|
6202
6202
|
unsafeWritable: boolean;
|
|
6203
6203
|
studio?: boolean | undefined;
|
|
6204
|
-
|
|
6205
|
-
|
|
6204
|
+
tables?: Record<string, {
|
|
6205
|
+
columns: Record<string, {
|
|
6206
6206
|
type: "boolean";
|
|
6207
6207
|
schema: {
|
|
6208
6208
|
optional: boolean;
|
|
@@ -6284,7 +6284,7 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
6284
6284
|
}> | undefined;
|
|
6285
6285
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
6286
6286
|
} | {
|
|
6287
|
-
|
|
6287
|
+
columns: Record<string, {
|
|
6288
6288
|
type: "boolean";
|
|
6289
6289
|
schema: {
|
|
6290
6290
|
optional: boolean;
|
|
@@ -6366,21 +6366,22 @@ export declare const dbConfigSchema: z.ZodObject<{
|
|
|
6366
6366
|
}> | undefined;
|
|
6367
6367
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
6368
6368
|
}> | undefined;
|
|
6369
|
-
data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
6369
|
+
data?: ((...args: unknown[]) => void | Promise<void>) | ((...args: unknown[]) => void | Promise<void>)[] | undefined;
|
|
6370
6370
|
}, {
|
|
6371
6371
|
studio?: boolean | undefined;
|
|
6372
|
-
|
|
6373
|
-
data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
6372
|
+
tables?: unknown;
|
|
6373
|
+
data?: ((...args: unknown[]) => void | Promise<void>) | ((...args: unknown[]) => void | Promise<void>)[] | undefined;
|
|
6374
6374
|
unsafeWritable?: boolean | undefined;
|
|
6375
6375
|
}>;
|
|
6376
|
+
type DataFunction = (params: DBDataContext) => MaybePromise<void>;
|
|
6376
6377
|
export type DBUserConfig = Omit<z.input<typeof dbConfigSchema>, 'data'> & {
|
|
6377
|
-
data
|
|
6378
|
+
data: DataFunction | DataFunction[];
|
|
6378
6379
|
};
|
|
6379
6380
|
export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
6380
6381
|
db: z.ZodOptional<z.ZodObject<{
|
|
6381
6382
|
studio: z.ZodOptional<z.ZodBoolean>;
|
|
6382
|
-
|
|
6383
|
-
|
|
6383
|
+
tables: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
6384
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
6384
6385
|
type: z.ZodLiteral<"boolean">;
|
|
6385
6386
|
schema: z.ZodObject<{
|
|
6386
6387
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -6476,7 +6477,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6476
6477
|
optional?: false | undefined;
|
|
6477
6478
|
default?: undefined;
|
|
6478
6479
|
})) & {
|
|
6479
|
-
references?: (() => z.input<typeof
|
|
6480
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
6480
6481
|
}>;
|
|
6481
6482
|
}, "strip", z.ZodTypeAny, {
|
|
6482
6483
|
type: "number";
|
|
@@ -6511,7 +6512,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6511
6512
|
optional?: boolean | undefined;
|
|
6512
6513
|
default?: number | SQL<any> | undefined;
|
|
6513
6514
|
} & {
|
|
6514
|
-
references?: (() => z.input<typeof
|
|
6515
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
6515
6516
|
}) | ({
|
|
6516
6517
|
name?: string | undefined;
|
|
6517
6518
|
label?: string | undefined;
|
|
@@ -6522,7 +6523,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6522
6523
|
optional?: false | undefined;
|
|
6523
6524
|
default?: undefined;
|
|
6524
6525
|
} & {
|
|
6525
|
-
references?: (() => z.input<typeof
|
|
6526
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
6526
6527
|
});
|
|
6527
6528
|
}>, z.ZodObject<{
|
|
6528
6529
|
type: z.ZodLiteral<"text">;
|
|
@@ -6578,7 +6579,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6578
6579
|
primaryKey: true;
|
|
6579
6580
|
optional?: false | undefined;
|
|
6580
6581
|
})) & {
|
|
6581
|
-
references?: (() => z.input<typeof
|
|
6582
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
6582
6583
|
}>;
|
|
6583
6584
|
}, "strip", z.ZodTypeAny, {
|
|
6584
6585
|
type: "text";
|
|
@@ -6616,7 +6617,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6616
6617
|
primaryKey?: false | undefined;
|
|
6617
6618
|
optional?: boolean | undefined;
|
|
6618
6619
|
} & {
|
|
6619
|
-
references?: (() => z.input<typeof
|
|
6620
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
6620
6621
|
}) | ({
|
|
6621
6622
|
name?: string | undefined;
|
|
6622
6623
|
label?: string | undefined;
|
|
@@ -6628,7 +6629,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6628
6629
|
primaryKey: true;
|
|
6629
6630
|
optional?: false | undefined;
|
|
6630
6631
|
} & {
|
|
6631
|
-
references?: (() => z.input<typeof
|
|
6632
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
6632
6633
|
});
|
|
6633
6634
|
}>, z.ZodObject<{
|
|
6634
6635
|
type: z.ZodLiteral<"date">;
|
|
@@ -6732,7 +6733,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6732
6733
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
6733
6734
|
writable: z.ZodLiteral<false>;
|
|
6734
6735
|
}, "strip", z.ZodTypeAny, {
|
|
6735
|
-
|
|
6736
|
+
columns: Record<string, {
|
|
6736
6737
|
type: "boolean";
|
|
6737
6738
|
schema: {
|
|
6738
6739
|
optional: boolean;
|
|
@@ -6814,7 +6815,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6814
6815
|
}> | undefined;
|
|
6815
6816
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
6816
6817
|
}, {
|
|
6817
|
-
|
|
6818
|
+
columns: Record<string, {
|
|
6818
6819
|
type: "boolean";
|
|
6819
6820
|
schema: {
|
|
6820
6821
|
name?: string | undefined;
|
|
@@ -6836,7 +6837,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6836
6837
|
optional?: boolean | undefined;
|
|
6837
6838
|
default?: number | SQL<any> | undefined;
|
|
6838
6839
|
} & {
|
|
6839
|
-
references?: (() => z.input<typeof
|
|
6840
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
6840
6841
|
}) | ({
|
|
6841
6842
|
name?: string | undefined;
|
|
6842
6843
|
label?: string | undefined;
|
|
@@ -6847,7 +6848,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6847
6848
|
optional?: false | undefined;
|
|
6848
6849
|
default?: undefined;
|
|
6849
6850
|
} & {
|
|
6850
|
-
references?: (() => z.input<typeof
|
|
6851
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
6851
6852
|
});
|
|
6852
6853
|
} | {
|
|
6853
6854
|
type: "text";
|
|
@@ -6862,7 +6863,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6862
6863
|
primaryKey?: false | undefined;
|
|
6863
6864
|
optional?: boolean | undefined;
|
|
6864
6865
|
} & {
|
|
6865
|
-
references?: (() => z.input<typeof
|
|
6866
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
6866
6867
|
}) | ({
|
|
6867
6868
|
name?: string | undefined;
|
|
6868
6869
|
label?: string | undefined;
|
|
@@ -6874,7 +6875,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6874
6875
|
primaryKey: true;
|
|
6875
6876
|
optional?: false | undefined;
|
|
6876
6877
|
} & {
|
|
6877
|
-
references?: (() => z.input<typeof
|
|
6878
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
6878
6879
|
});
|
|
6879
6880
|
} | {
|
|
6880
6881
|
type: "date";
|
|
@@ -6904,7 +6905,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
6904
6905
|
}> | undefined;
|
|
6905
6906
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
6906
6907
|
}>, z.ZodObject<{
|
|
6907
|
-
|
|
6908
|
+
columns: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
6908
6909
|
type: z.ZodLiteral<"boolean">;
|
|
6909
6910
|
schema: z.ZodObject<{
|
|
6910
6911
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -7000,7 +7001,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7000
7001
|
optional?: false | undefined;
|
|
7001
7002
|
default?: undefined;
|
|
7002
7003
|
})) & {
|
|
7003
|
-
references?: (() => z.input<typeof
|
|
7004
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
7004
7005
|
}>;
|
|
7005
7006
|
}, "strip", z.ZodTypeAny, {
|
|
7006
7007
|
type: "number";
|
|
@@ -7035,7 +7036,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7035
7036
|
optional?: boolean | undefined;
|
|
7036
7037
|
default?: number | SQL<any> | undefined;
|
|
7037
7038
|
} & {
|
|
7038
|
-
references?: (() => z.input<typeof
|
|
7039
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
7039
7040
|
}) | ({
|
|
7040
7041
|
name?: string | undefined;
|
|
7041
7042
|
label?: string | undefined;
|
|
@@ -7046,7 +7047,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7046
7047
|
optional?: false | undefined;
|
|
7047
7048
|
default?: undefined;
|
|
7048
7049
|
} & {
|
|
7049
|
-
references?: (() => z.input<typeof
|
|
7050
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
7050
7051
|
});
|
|
7051
7052
|
}>, z.ZodObject<{
|
|
7052
7053
|
type: z.ZodLiteral<"text">;
|
|
@@ -7102,7 +7103,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7102
7103
|
primaryKey: true;
|
|
7103
7104
|
optional?: false | undefined;
|
|
7104
7105
|
})) & {
|
|
7105
|
-
references?: (() => z.input<typeof
|
|
7106
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
7106
7107
|
}>;
|
|
7107
7108
|
}, "strip", z.ZodTypeAny, {
|
|
7108
7109
|
type: "text";
|
|
@@ -7140,7 +7141,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7140
7141
|
primaryKey?: false | undefined;
|
|
7141
7142
|
optional?: boolean | undefined;
|
|
7142
7143
|
} & {
|
|
7143
|
-
references?: (() => z.input<typeof
|
|
7144
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
7144
7145
|
}) | ({
|
|
7145
7146
|
name?: string | undefined;
|
|
7146
7147
|
label?: string | undefined;
|
|
@@ -7152,7 +7153,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7152
7153
|
primaryKey: true;
|
|
7153
7154
|
optional?: false | undefined;
|
|
7154
7155
|
} & {
|
|
7155
|
-
references?: (() => z.input<typeof
|
|
7156
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
7156
7157
|
});
|
|
7157
7158
|
}>, z.ZodObject<{
|
|
7158
7159
|
type: z.ZodLiteral<"date">;
|
|
@@ -7256,7 +7257,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7256
7257
|
foreignKeys: z.ZodOptional<z.ZodArray<z.ZodType<ForeignKeysOutput, z.ZodTypeDef, ForeignKeysInput>, "many">>;
|
|
7257
7258
|
writable: z.ZodLiteral<true>;
|
|
7258
7259
|
}, "strip", z.ZodTypeAny, {
|
|
7259
|
-
|
|
7260
|
+
columns: Record<string, {
|
|
7260
7261
|
type: "boolean";
|
|
7261
7262
|
schema: {
|
|
7262
7263
|
optional: boolean;
|
|
@@ -7338,7 +7339,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7338
7339
|
}> | undefined;
|
|
7339
7340
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
7340
7341
|
}, {
|
|
7341
|
-
|
|
7342
|
+
columns: Record<string, {
|
|
7342
7343
|
type: "boolean";
|
|
7343
7344
|
schema: {
|
|
7344
7345
|
name?: string | undefined;
|
|
@@ -7360,7 +7361,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7360
7361
|
optional?: boolean | undefined;
|
|
7361
7362
|
default?: number | SQL<any> | undefined;
|
|
7362
7363
|
} & {
|
|
7363
|
-
references?: (() => z.input<typeof
|
|
7364
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
7364
7365
|
}) | ({
|
|
7365
7366
|
name?: string | undefined;
|
|
7366
7367
|
label?: string | undefined;
|
|
@@ -7371,7 +7372,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7371
7372
|
optional?: false | undefined;
|
|
7372
7373
|
default?: undefined;
|
|
7373
7374
|
} & {
|
|
7374
|
-
references?: (() => z.input<typeof
|
|
7375
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
7375
7376
|
});
|
|
7376
7377
|
} | {
|
|
7377
7378
|
type: "text";
|
|
@@ -7386,7 +7387,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7386
7387
|
primaryKey?: false | undefined;
|
|
7387
7388
|
optional?: boolean | undefined;
|
|
7388
7389
|
} & {
|
|
7389
|
-
references?: (() => z.input<typeof
|
|
7390
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
7390
7391
|
}) | ({
|
|
7391
7392
|
name?: string | undefined;
|
|
7392
7393
|
label?: string | undefined;
|
|
@@ -7398,7 +7399,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7398
7399
|
primaryKey: true;
|
|
7399
7400
|
optional?: false | undefined;
|
|
7400
7401
|
} & {
|
|
7401
|
-
references?: (() => z.input<typeof
|
|
7402
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
7402
7403
|
});
|
|
7403
7404
|
} | {
|
|
7404
7405
|
type: "date";
|
|
@@ -7428,7 +7429,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7428
7429
|
}> | undefined;
|
|
7429
7430
|
foreignKeys?: ForeignKeysInput[] | undefined;
|
|
7430
7431
|
}>]>>, Record<string, {
|
|
7431
|
-
|
|
7432
|
+
columns: Record<string, {
|
|
7432
7433
|
type: "boolean";
|
|
7433
7434
|
schema: {
|
|
7434
7435
|
optional: boolean;
|
|
@@ -7510,7 +7511,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7510
7511
|
}> | undefined;
|
|
7511
7512
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
7512
7513
|
} | {
|
|
7513
|
-
|
|
7514
|
+
columns: Record<string, {
|
|
7514
7515
|
type: "boolean";
|
|
7515
7516
|
schema: {
|
|
7516
7517
|
optional: boolean;
|
|
@@ -7592,13 +7593,13 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7592
7593
|
}> | undefined;
|
|
7593
7594
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
7594
7595
|
}>, unknown>>;
|
|
7595
|
-
data: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]
|
|
7596
|
+
data: z.ZodOptional<z.ZodUnion<[z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, z.ZodArray<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>, "many">]>>;
|
|
7596
7597
|
unsafeWritable: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7597
7598
|
}, "strip", z.ZodTypeAny, {
|
|
7598
7599
|
unsafeWritable: boolean;
|
|
7599
7600
|
studio?: boolean | undefined;
|
|
7600
|
-
|
|
7601
|
-
|
|
7601
|
+
tables?: Record<string, {
|
|
7602
|
+
columns: Record<string, {
|
|
7602
7603
|
type: "boolean";
|
|
7603
7604
|
schema: {
|
|
7604
7605
|
optional: boolean;
|
|
@@ -7680,7 +7681,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7680
7681
|
}> | undefined;
|
|
7681
7682
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
7682
7683
|
} | {
|
|
7683
|
-
|
|
7684
|
+
columns: Record<string, {
|
|
7684
7685
|
type: "boolean";
|
|
7685
7686
|
schema: {
|
|
7686
7687
|
optional: boolean;
|
|
@@ -7762,19 +7763,19 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7762
7763
|
}> | undefined;
|
|
7763
7764
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
7764
7765
|
}> | undefined;
|
|
7765
|
-
data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
7766
|
+
data?: ((...args: unknown[]) => void | Promise<void>) | ((...args: unknown[]) => void | Promise<void>)[] | undefined;
|
|
7766
7767
|
}, {
|
|
7767
7768
|
studio?: boolean | undefined;
|
|
7768
|
-
|
|
7769
|
-
data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
7769
|
+
tables?: unknown;
|
|
7770
|
+
data?: ((...args: unknown[]) => void | Promise<void>) | ((...args: unknown[]) => void | Promise<void>)[] | undefined;
|
|
7770
7771
|
unsafeWritable?: boolean | undefined;
|
|
7771
7772
|
}>>;
|
|
7772
7773
|
}, "strip", z.ZodTypeAny, {
|
|
7773
7774
|
db?: {
|
|
7774
7775
|
unsafeWritable: boolean;
|
|
7775
7776
|
studio?: boolean | undefined;
|
|
7776
|
-
|
|
7777
|
-
|
|
7777
|
+
tables?: Record<string, {
|
|
7778
|
+
columns: Record<string, {
|
|
7778
7779
|
type: "boolean";
|
|
7779
7780
|
schema: {
|
|
7780
7781
|
optional: boolean;
|
|
@@ -7856,7 +7857,7 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7856
7857
|
}> | undefined;
|
|
7857
7858
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
7858
7859
|
} | {
|
|
7859
|
-
|
|
7860
|
+
columns: Record<string, {
|
|
7860
7861
|
type: "boolean";
|
|
7861
7862
|
schema: {
|
|
7862
7863
|
optional: boolean;
|
|
@@ -7938,36 +7939,36 @@ export declare const astroConfigWithDbSchema: z.ZodObject<{
|
|
|
7938
7939
|
}> | undefined;
|
|
7939
7940
|
foreignKeys?: ForeignKeysOutput[] | undefined;
|
|
7940
7941
|
}> | undefined;
|
|
7941
|
-
data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
7942
|
+
data?: ((...args: unknown[]) => void | Promise<void>) | ((...args: unknown[]) => void | Promise<void>)[] | undefined;
|
|
7942
7943
|
} | undefined;
|
|
7943
7944
|
}, {
|
|
7944
7945
|
db?: {
|
|
7945
7946
|
studio?: boolean | undefined;
|
|
7946
|
-
|
|
7947
|
-
data?: ((...args: unknown[]) => void | Promise<void>) | undefined;
|
|
7947
|
+
tables?: unknown;
|
|
7948
|
+
data?: ((...args: unknown[]) => void | Promise<void>) | ((...args: unknown[]) => void | Promise<void>)[] | undefined;
|
|
7948
7949
|
unsafeWritable?: boolean | undefined;
|
|
7949
7950
|
} | undefined;
|
|
7950
7951
|
}>;
|
|
7951
|
-
export type
|
|
7952
|
-
interface CollectionConfig<
|
|
7953
|
-
|
|
7952
|
+
export type ColumnsConfig = z.input<typeof collectionSchema>['columns'];
|
|
7953
|
+
interface CollectionConfig<TColumns extends ColumnsConfig = ColumnsConfig> extends Pick<z.input<typeof collectionSchema>, 'columns' | 'indexes' | 'foreignKeys'> {
|
|
7954
|
+
columns: TColumns;
|
|
7954
7955
|
foreignKeys?: Array<{
|
|
7955
|
-
|
|
7956
|
-
references: () => MaybeArray<z.input<typeof
|
|
7956
|
+
columns: MaybeArray<Extract<keyof TColumns, string>>;
|
|
7957
|
+
references: () => MaybeArray<z.input<typeof referenceableColumnSchema>>;
|
|
7957
7958
|
}>;
|
|
7958
|
-
indexes?: Record<string, IndexConfig<
|
|
7959
|
+
indexes?: Record<string, IndexConfig<TColumns>>;
|
|
7959
7960
|
}
|
|
7960
|
-
interface IndexConfig<
|
|
7961
|
-
on: MaybeArray<Extract<keyof
|
|
7961
|
+
interface IndexConfig<TColumns extends ColumnsConfig> extends z.input<typeof indexSchema> {
|
|
7962
|
+
on: MaybeArray<Extract<keyof TColumns, string>>;
|
|
7962
7963
|
}
|
|
7963
|
-
export type ResolvedCollectionConfig<
|
|
7964
|
+
export type ResolvedCollectionConfig<TColumns extends ColumnsConfig = ColumnsConfig, Writable extends boolean = boolean> = CollectionConfig<TColumns> & {
|
|
7964
7965
|
writable: Writable;
|
|
7965
|
-
table: Table<string,
|
|
7966
|
+
table: Table<string, TColumns>;
|
|
7966
7967
|
};
|
|
7967
|
-
export declare function
|
|
7968
|
-
export declare function
|
|
7968
|
+
export declare function defineReadableTable<TColumns extends ColumnsConfig>(userConfig: CollectionConfig<TColumns>): ResolvedCollectionConfig<TColumns, false>;
|
|
7969
|
+
export declare function defineWritableTable<TColumns extends ColumnsConfig>(userConfig: CollectionConfig<TColumns>): ResolvedCollectionConfig<TColumns, true>;
|
|
7969
7970
|
export type AstroConfigWithDB = z.input<typeof astroConfigWithDbSchema>;
|
|
7970
|
-
export declare const
|
|
7971
|
+
export declare const column: {
|
|
7971
7972
|
number: <T extends ({
|
|
7972
7973
|
name?: string | undefined;
|
|
7973
7974
|
label?: string | undefined;
|
|
@@ -7982,7 +7983,7 @@ export declare const field: {
|
|
|
7982
7983
|
optional?: false | undefined;
|
|
7983
7984
|
default?: undefined;
|
|
7984
7985
|
})) & {
|
|
7985
|
-
references?: (() => z.input<typeof
|
|
7986
|
+
references?: (() => z.input<typeof numberColumnSchema>) | undefined;
|
|
7986
7987
|
}>(opts?: T) => {
|
|
7987
7988
|
type: "number";
|
|
7988
7989
|
/**
|
|
@@ -8018,7 +8019,7 @@ export declare const field: {
|
|
|
8018
8019
|
primaryKey: true;
|
|
8019
8020
|
optional?: false | undefined;
|
|
8020
8021
|
})) & {
|
|
8021
|
-
references?: (() => z.input<typeof
|
|
8022
|
+
references?: (() => z.input<typeof textColumnSchema>) | undefined;
|
|
8022
8023
|
}>(opts?: T_2) => {
|
|
8023
8024
|
type: "text";
|
|
8024
8025
|
/**
|