drizzle-kit 0.20.17-4e262b7 → 0.20.17-7776aba

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 +22248 -23435
  2. package/cli/commands/migrate.d.ts +135 -152
  3. package/cli/commands/mysqlIntrospect.d.ts +79 -15
  4. package/cli/commands/mysqlPushUtils.d.ts +8 -4
  5. package/cli/commands/mysqlUp.d.ts +4 -0
  6. package/cli/commands/pgConnect.d.ts +5 -0
  7. package/cli/commands/pgIntrospect.d.ts +76 -12
  8. package/cli/commands/pgPushUtils.d.ts +6 -3
  9. package/cli/commands/pgUp.d.ts +4 -0
  10. package/cli/commands/sqliteIntrospect.d.ts +29 -26
  11. package/cli/commands/sqlitePushUtils.d.ts +10 -4
  12. package/cli/commands/sqliteUtils.d.ts +162 -0
  13. package/cli/commands/upFolders.d.ts +27 -0
  14. package/cli/commands/utils.d.ts +255 -39
  15. package/cli/validations/common.d.ts +7 -208
  16. package/cli/validations/mysql.d.ts +337 -7
  17. package/cli/validations/outputs.d.ts +0 -1
  18. package/cli/validations/pg.d.ts +405 -4
  19. package/cli/views.d.ts +5 -7
  20. package/drivers/index.d.ts +39 -0
  21. package/global.d.ts +1 -3
  22. package/index.d.mts +6 -8
  23. package/index.d.ts +6 -8
  24. package/index.js +0 -1
  25. package/introspect-mysql.d.ts +9 -0
  26. package/introspect-pg.d.ts +12 -0
  27. package/introspect-sqlite.d.ts +2 -2
  28. package/jsonDiffer.d.ts +29 -14
  29. package/jsonStatements.d.ts +11 -38
  30. package/package.json +52 -24
  31. package/payload.d.mts +5 -5
  32. package/payload.d.ts +5 -5
  33. package/payload.js +24222 -26044
  34. package/payload.mjs +19956 -21767
  35. package/schemaValidator.d.ts +286 -289
  36. package/serializer/mysqlImports.d.ts +7 -3
  37. package/serializer/mysqlSchema.d.ts +1323 -2454
  38. package/serializer/mysqlSerializer.d.ts +6 -6
  39. package/serializer/pgImports.d.ts +2 -2
  40. package/serializer/pgSchema.d.ts +1283 -1742
  41. package/serializer/pgSerializer.d.ts +2 -2
  42. package/serializer/sqliteImports.d.ts +4 -2
  43. package/serializer/sqliteSchema.d.ts +979 -553
  44. package/serializer/sqliteSerializer.d.ts +4 -4
  45. package/snapshotsDiffer.d.ts +1209 -2486
  46. package/utils/words.d.ts +1 -1
  47. package/utils-studio.d.mts +1 -0
  48. package/utils-studio.d.ts +1 -0
  49. package/utils-studio.js +849 -7058
  50. package/utils-studio.mjs +829 -7035
  51. package/utils.d.ts +141 -14
  52. package/utils.js +7161 -4625
  53. package/utils.mjs +7121 -4585
  54. package/cli/utils.d.ts +0 -12
  55. package/cli/validations/cli.d.ts +0 -169
  56. package/cli/validations/sqlite.d.ts +0 -34
package/utils.d.ts CHANGED
@@ -1,15 +1,6 @@
1
1
  import type { Dialect } from "./schemaValidator";
2
- import type { NamedWithSchema } from "./cli/commands/migrate";
3
- export type DB = {
4
- query: <T extends any = any>(sql: string, params?: any[]) => Promise<T[]>;
5
- };
6
- export type SQLiteDB = {
7
- query: <T extends any = any>(sql: string, params?: any[]) => Promise<T[]>;
8
- run(query: string): Promise<void>;
9
- };
10
- export declare const copy: <T>(it: T) => T;
11
- export declare const objectValues: <T extends object>(obj: T) => Array<T[keyof T]>;
12
- export declare const assertV1OutFolder: (out: string) => void;
2
+ import { NamedWithSchema } from "./cli/commands/migrate";
3
+ export declare const assertV1OutFolder: (out: string, dialect: Dialect | "{dialect}") => void;
13
4
  export type Journal = {
14
5
  version: string;
15
6
  dialect: Dialect;
@@ -22,6 +13,7 @@ export type Journal = {
22
13
  }[];
23
14
  };
24
15
  export declare const dryJournal: (dialect: Dialect) => Journal;
16
+ export declare const snapshotsPriorV4: (out: string) => string[];
25
17
  export declare const prepareOutFolder: (out: string, dialect: Dialect) => {
26
18
  meta: string;
27
19
  snapshots: string[];
@@ -58,9 +50,9 @@ export declare const prepareMigrationMeta: (schemas: {
58
50
  column: string;
59
51
  };
60
52
  }[]) => {
61
- schemas: Record<string, string>;
62
- tables: Record<string, string>;
63
- columns: Record<string, string>;
53
+ schemas: {};
54
+ tables: {};
55
+ columns: {};
64
56
  };
65
57
  export declare const schemaRenameKey: (it: string) => string;
66
58
  export declare const tableRenameKey: (it: NamedWithSchema) => string;
@@ -70,3 +62,138 @@ export declare const kloudMeta: () => {
70
62
  mysql: number[];
71
63
  sqlite: number[];
72
64
  };
65
+ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
66
+ left: {
67
+ internal?: {
68
+ tables: Record<string, {
69
+ columns: Record<string, {
70
+ isArray?: boolean | undefined;
71
+ dimensions?: number | undefined;
72
+ rawType?: string | undefined;
73
+ } | undefined>;
74
+ } | undefined>;
75
+ } | undefined;
76
+ id: string;
77
+ prevId: string;
78
+ version: "5";
79
+ dialect: "pg";
80
+ tables: Record<string, {
81
+ name: string;
82
+ columns: Record<string, {
83
+ isUnique?: any;
84
+ default?: any;
85
+ uniqueName?: string | undefined;
86
+ nullsNotDistinct?: boolean | undefined;
87
+ name: string;
88
+ type: string;
89
+ primaryKey: boolean;
90
+ notNull: boolean;
91
+ }>;
92
+ indexes: Record<string, {
93
+ name: string;
94
+ columns: string[];
95
+ isUnique: boolean;
96
+ }>;
97
+ foreignKeys: Record<string, {
98
+ onUpdate?: string | undefined;
99
+ onDelete?: string | undefined;
100
+ schemaTo?: string | undefined;
101
+ name: string;
102
+ tableFrom: string;
103
+ columnsFrom: string[];
104
+ tableTo: string;
105
+ columnsTo: string[];
106
+ }>;
107
+ schema: string;
108
+ compositePrimaryKeys: Record<string, {
109
+ name: string;
110
+ columns: string[];
111
+ }>;
112
+ uniqueConstraints: Record<string, {
113
+ name: string;
114
+ columns: string[];
115
+ nullsNotDistinct: boolean;
116
+ }>;
117
+ }>;
118
+ schemas: Record<string, string>;
119
+ _meta: {
120
+ columns: Record<string, string>;
121
+ tables: Record<string, string>;
122
+ schemas: Record<string, string>;
123
+ };
124
+ enums: Record<string, {
125
+ name: string;
126
+ values: Record<string, string>;
127
+ }>;
128
+ };
129
+ right: {
130
+ internal?: {
131
+ tables: Record<string, {
132
+ columns: Record<string, {
133
+ isArray?: boolean | undefined;
134
+ dimensions?: number | undefined;
135
+ rawType?: string | undefined;
136
+ } | undefined>;
137
+ } | undefined>;
138
+ } | undefined;
139
+ id: string;
140
+ prevId: string;
141
+ version: "5";
142
+ dialect: "pg";
143
+ tables: Record<string, {
144
+ name: string;
145
+ columns: Record<string, {
146
+ isUnique?: any;
147
+ default?: any;
148
+ uniqueName?: string | undefined;
149
+ nullsNotDistinct?: boolean | undefined;
150
+ name: string;
151
+ type: string;
152
+ primaryKey: boolean;
153
+ notNull: boolean;
154
+ }>;
155
+ indexes: Record<string, {
156
+ name: string;
157
+ columns: string[];
158
+ isUnique: boolean;
159
+ }>;
160
+ foreignKeys: Record<string, {
161
+ onUpdate?: string | undefined;
162
+ onDelete?: string | undefined;
163
+ schemaTo?: string | undefined;
164
+ name: string;
165
+ tableFrom: string;
166
+ columnsFrom: string[];
167
+ tableTo: string;
168
+ columnsTo: string[];
169
+ }>;
170
+ schema: string;
171
+ compositePrimaryKeys: Record<string, {
172
+ name: string;
173
+ columns: string[];
174
+ }>;
175
+ uniqueConstraints: Record<string, {
176
+ name: string;
177
+ columns: string[];
178
+ nullsNotDistinct: boolean;
179
+ }>;
180
+ }>;
181
+ schemas: Record<string, string>;
182
+ _meta: {
183
+ columns: Record<string, string>;
184
+ tables: Record<string, string>;
185
+ schemas: Record<string, string>;
186
+ };
187
+ enums: Record<string, {
188
+ name: string;
189
+ values: Record<string, string>;
190
+ }>;
191
+ };
192
+ statements: import("./jsonStatements").JsonStatement[];
193
+ sqlStatements: string[];
194
+ _meta: {
195
+ schemas: {};
196
+ tables: {};
197
+ columns: {};
198
+ } | undefined;
199
+ }>;