drizzle-kit 0.20.16 → 0.20.17-7f33638

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/bin.cjs +28192 -26852
  2. package/cli/commands/migrate.d.ts +152 -135
  3. package/cli/commands/mysqlIntrospect.d.ts +15 -79
  4. package/cli/commands/mysqlPushUtils.d.ts +4 -8
  5. package/cli/commands/pgIntrospect.d.ts +12 -76
  6. package/cli/commands/pgPushUtils.d.ts +3 -6
  7. package/cli/commands/sqliteIntrospect.d.ts +26 -29
  8. package/cli/commands/sqlitePushUtils.d.ts +4 -10
  9. package/cli/commands/utils.d.ts +39 -255
  10. package/cli/utils.d.ts +12 -0
  11. package/cli/validations/cli.d.ts +169 -0
  12. package/cli/validations/common.d.ts +208 -7
  13. package/cli/validations/mysql.d.ts +7 -337
  14. package/cli/validations/outputs.d.ts +1 -0
  15. package/cli/validations/pg.d.ts +4 -405
  16. package/cli/validations/sqlite.d.ts +34 -0
  17. package/cli/views.d.ts +7 -5
  18. package/global.d.ts +3 -1
  19. package/index.d.mts +8 -6
  20. package/index.d.ts +8 -6
  21. package/index.js +1 -0
  22. package/introspect-sqlite.d.ts +2 -2
  23. package/jsonDiffer.d.ts +14 -29
  24. package/jsonStatements.d.ts +38 -11
  25. package/package.json +24 -52
  26. package/payload.d.mts +5 -5
  27. package/payload.d.ts +5 -5
  28. package/payload.js +34054 -32232
  29. package/payload.mjs +26477 -24666
  30. package/schemaValidator.d.ts +289 -286
  31. package/serializer/mysqlImports.d.ts +3 -7
  32. package/serializer/mysqlSchema.d.ts +2501 -1370
  33. package/serializer/mysqlSerializer.d.ts +6 -6
  34. package/serializer/pgImports.d.ts +2 -2
  35. package/serializer/pgSchema.d.ts +1741 -1282
  36. package/serializer/pgSerializer.d.ts +2 -2
  37. package/serializer/sqliteImports.d.ts +2 -4
  38. package/serializer/sqliteSchema.d.ts +553 -979
  39. package/serializer/sqliteSerializer.d.ts +4 -4
  40. package/snapshotsDiffer.d.ts +2486 -1209
  41. package/utils/words.d.ts +1 -1
  42. package/utils-studio.d.mts +0 -1
  43. package/utils-studio.d.ts +0 -1
  44. package/utils-studio.js +7056 -847
  45. package/utils-studio.mjs +7034 -828
  46. package/utils.d.ts +14 -141
  47. package/utils.js +4381 -6917
  48. package/utils.mjs +4594 -7130
  49. package/cli/commands/mysqlUp.d.ts +0 -4
  50. package/cli/commands/pgConnect.d.ts +0 -5
  51. package/cli/commands/pgUp.d.ts +0 -4
  52. package/cli/commands/sqliteUtils.d.ts +0 -162
  53. package/cli/commands/upFolders.d.ts +0 -27
  54. package/drivers/index.d.ts +0 -39
  55. package/introspect-mysql.d.ts +0 -9
  56. package/introspect-pg.d.ts +0 -12
@@ -1,4 +0,0 @@
1
- import { MySqlSchema, MySqlSchemaV4 } from "src/serializer/mysqlSchema";
2
- export declare const upMysqlHandler: (out: string) => void;
3
- export declare const upMySqlHandlerV4toV5: (obj: MySqlSchemaV4) => MySqlSchema;
4
- export declare const upMysqlHandlerV4: (out: string) => void;
@@ -1,5 +0,0 @@
1
- import type { PgConnectionConfig } from "../validations/pg";
2
- import { PgPostgres } from "src/drivers";
3
- export declare const connectToPg: (config: PgConnectionConfig) => Promise<{
4
- client: PgPostgres;
5
- }>;
@@ -1,4 +0,0 @@
1
- import { PgSchema, PgSchemaV4 } from "src/serializer/pgSchema";
2
- export declare const upPgHandlerV4toV5: (obj: PgSchemaV4) => PgSchema;
3
- export declare const upPgHandler: (out: string) => void;
4
- export declare const upPgHandlerV4: (out: string) => void;
@@ -1,162 +0,0 @@
1
- import { TypeOf } from "zod";
2
- import { configIntrospectSchema } from "./utils";
3
- export declare const sqliteConnectionSchema: import("zod").ZodUnion<[import("zod").ZodObject<{
4
- driver: import("zod").ZodLiteral<"turso">;
5
- dbCredentials: import("zod").ZodObject<{
6
- url: import("zod").ZodString;
7
- authToken: import("zod").ZodOptional<import("zod").ZodString>;
8
- }, "strip", import("zod").ZodTypeAny, {
9
- authToken?: string | undefined;
10
- url: string;
11
- }, {
12
- authToken?: string | undefined;
13
- url: string;
14
- }>;
15
- }, "strip", import("zod").ZodTypeAny, {
16
- driver: "turso";
17
- dbCredentials: {
18
- authToken?: string | undefined;
19
- url: string;
20
- };
21
- }, {
22
- driver: "turso";
23
- dbCredentials: {
24
- authToken?: string | undefined;
25
- url: string;
26
- };
27
- }>, import("zod").ZodObject<{
28
- driver: import("zod").ZodLiteral<"libsql">;
29
- dbCredentials: import("zod").ZodObject<{
30
- url: import("zod").ZodString;
31
- }, "strip", import("zod").ZodTypeAny, {
32
- url: string;
33
- }, {
34
- url: string;
35
- }>;
36
- }, "strip", import("zod").ZodTypeAny, {
37
- driver: "libsql";
38
- dbCredentials: {
39
- url: string;
40
- };
41
- }, {
42
- driver: "libsql";
43
- dbCredentials: {
44
- url: string;
45
- };
46
- }>, import("zod").ZodObject<{
47
- driver: import("zod").ZodLiteral<"better-sqlite">;
48
- dbCredentials: import("zod").ZodObject<{
49
- url: import("zod").ZodString;
50
- }, "strip", import("zod").ZodTypeAny, {
51
- url: string;
52
- }, {
53
- url: string;
54
- }>;
55
- }, "strip", import("zod").ZodTypeAny, {
56
- driver: "better-sqlite";
57
- dbCredentials: {
58
- url: string;
59
- };
60
- }, {
61
- driver: "better-sqlite";
62
- dbCredentials: {
63
- url: string;
64
- };
65
- }>]>;
66
- export declare const sqliteCliConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
67
- schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
68
- out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
69
- breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
70
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
71
- schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
72
- introspect: import("zod").ZodDefault<import("zod").ZodObject<{
73
- casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
74
- }, "strip", import("zod").ZodTypeAny, {
75
- casing: "camel" | "preserve";
76
- }, {
77
- casing?: "camel" | "preserve" | undefined;
78
- }>>;
79
- }, "strip", import("zod").ZodTypeAny, {
80
- schema?: string | string[] | undefined;
81
- tablesFilter?: string | string[] | undefined;
82
- out: string;
83
- breakpoints: boolean;
84
- schemaFilter: string | string[];
85
- introspect: {
86
- casing: "camel" | "preserve";
87
- };
88
- }, {
89
- schema?: string | string[] | undefined;
90
- out?: string | undefined;
91
- breakpoints?: boolean | undefined;
92
- tablesFilter?: string | string[] | undefined;
93
- schemaFilter?: string | string[] | undefined;
94
- introspect?: {
95
- casing?: "camel" | "preserve" | undefined;
96
- } | undefined;
97
- }>, import("zod").ZodUnion<[import("zod").ZodObject<{
98
- driver: import("zod").ZodLiteral<"turso">;
99
- dbCredentials: import("zod").ZodObject<{
100
- url: import("zod").ZodString;
101
- authToken: import("zod").ZodOptional<import("zod").ZodString>;
102
- }, "strip", import("zod").ZodTypeAny, {
103
- authToken?: string | undefined;
104
- url: string;
105
- }, {
106
- authToken?: string | undefined;
107
- url: string;
108
- }>;
109
- }, "strip", import("zod").ZodTypeAny, {
110
- driver: "turso";
111
- dbCredentials: {
112
- authToken?: string | undefined;
113
- url: string;
114
- };
115
- }, {
116
- driver: "turso";
117
- dbCredentials: {
118
- authToken?: string | undefined;
119
- url: string;
120
- };
121
- }>, import("zod").ZodObject<{
122
- driver: import("zod").ZodLiteral<"libsql">;
123
- dbCredentials: import("zod").ZodObject<{
124
- url: import("zod").ZodString;
125
- }, "strip", import("zod").ZodTypeAny, {
126
- url: string;
127
- }, {
128
- url: string;
129
- }>;
130
- }, "strip", import("zod").ZodTypeAny, {
131
- driver: "libsql";
132
- dbCredentials: {
133
- url: string;
134
- };
135
- }, {
136
- driver: "libsql";
137
- dbCredentials: {
138
- url: string;
139
- };
140
- }>, import("zod").ZodObject<{
141
- driver: import("zod").ZodLiteral<"better-sqlite">;
142
- dbCredentials: import("zod").ZodObject<{
143
- url: import("zod").ZodString;
144
- }, "strip", import("zod").ZodTypeAny, {
145
- url: string;
146
- }, {
147
- url: string;
148
- }>;
149
- }, "strip", import("zod").ZodTypeAny, {
150
- driver: "better-sqlite";
151
- dbCredentials: {
152
- url: string;
153
- };
154
- }, {
155
- driver: "better-sqlite";
156
- dbCredentials: {
157
- url: string;
158
- };
159
- }>]>>;
160
- export type SQLiteCliConfig = TypeOf<typeof sqliteCliConfigSchema>;
161
- export type SQLiteConnectionConfig = TypeOf<typeof sqliteConnectionSchema>;
162
- export { configIntrospectSchema };
@@ -1,27 +0,0 @@
1
- import { Dialect } from "src/schemaValidator";
2
- import { Named, NamedWithSchema } from "./migrate";
3
- export declare const resolveSchemas: <T extends Named>(missingSchemas: T[], newSchemas: T[], predicate: (leftMissing: T[], created: T) => T | undefined) => {
4
- created: T[];
5
- renamed: {
6
- from: T;
7
- to: T;
8
- }[];
9
- deleted: T[];
10
- };
11
- export declare const resolveTables: <T extends NamedWithSchema>(missingTables: T[], newTables: T[], resolver: (leftMissing: T[], created: T) => T | undefined) => {
12
- created: T[];
13
- renamed: {
14
- from: T;
15
- to: T;
16
- }[];
17
- deleted: T[];
18
- };
19
- export declare const resolveColumns: <T extends Named>(missingColumns: T[], newColumns: T[], predicate: (leftMissing: T[], created: T) => T | undefined) => {
20
- created: T[];
21
- renamed: {
22
- from: T;
23
- to: T;
24
- }[];
25
- deleted: T[];
26
- };
27
- export declare const upgradeFolders: (dialect: Dialect, out: string) => void;
@@ -1,39 +0,0 @@
1
- import type { Client } from "@libsql/client";
2
- import { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
3
- import { MySql2Database } from "drizzle-orm/mysql2";
4
- import type { PgDatabase } from "drizzle-orm/pg-core";
5
- import type { Client as PgClient } from "pg";
6
- export declare abstract class DrizzleDbClient<T = any> {
7
- protected db: T;
8
- constructor(db: T);
9
- abstract query<K = any>(query: string, values?: any[]): Promise<K[]>;
10
- abstract run(query: string): Promise<void>;
11
- }
12
- export declare class DrizzleORMPgClient extends DrizzleDbClient<PgDatabase<any>> {
13
- query<K = any>(query: string, values?: any[] | undefined): Promise<K[]>;
14
- run(query: string): Promise<void>;
15
- }
16
- export declare class DrizzleORMMySQLClient extends DrizzleDbClient<MySql2Database<any>> {
17
- query<K = any>(query: string, values?: any[] | undefined): Promise<K[]>;
18
- run(query: string): Promise<void>;
19
- }
20
- export declare class DrizzleORMSQLiteClient extends DrizzleDbClient<BetterSQLite3Database<any>> {
21
- query<K = any>(query: string, values?: any[] | undefined): Promise<K[]>;
22
- run(query: string): Promise<void>;
23
- }
24
- export declare class BetterSqlite extends DrizzleDbClient {
25
- run(query: string): Promise<void>;
26
- query(query: string): Promise<any[]>;
27
- }
28
- export declare class MySQL2Client extends DrizzleDbClient {
29
- run(query: string): Promise<void>;
30
- query(query: string): Promise<any>;
31
- }
32
- export declare class TursoSqlite extends DrizzleDbClient<Client> {
33
- run(query: string): Promise<void>;
34
- query(query: string): Promise<any[]>;
35
- }
36
- export declare class PgPostgres extends DrizzleDbClient<PgClient> {
37
- query<K = any>(query: string, values?: any[]): Promise<K[]>;
38
- run(query: string): Promise<void>;
39
- }
@@ -1,9 +0,0 @@
1
- import "./@types/utils";
2
- import { ConfigIntrospectCasing } from "./cli/commands/utils";
3
- import { MySqlSchemaInternal } from "./serializer/mysqlSchema";
4
- export declare const schemaToTypeScript: (schema: MySqlSchemaInternal, casing: ConfigIntrospectCasing["casing"]) => {
5
- file: string;
6
- imports: string;
7
- decalrations: string;
8
- schemaEntry: string;
9
- };
@@ -1,12 +0,0 @@
1
- import { AnyPgTable } from "drizzle-orm/pg-core";
2
- import { Relation, Relations } from "drizzle-orm/relations";
3
- import "./@types/utils";
4
- import { ConfigIntrospectCasing } from "./cli/commands/utils";
5
- import { PgSchemaInternal } from "./serializer/pgSchema";
6
- export declare const relationsToTypeScript: (schema: Record<string, Record<string, AnyPgTable<{}>>>, relations: Record<string, Relations<string, Record<string, Relation<string>>>>) => string;
7
- export declare const schemaToTypeScript: (schema: PgSchemaInternal, casing: ConfigIntrospectCasing) => {
8
- file: string;
9
- imports: string;
10
- decalrations: string;
11
- schemaEntry: string;
12
- };