drizzle-kit 0.20.0-f39d8bc → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/@types/utils.d.ts +12 -0
  2. package/cli/commands/migrate.d.ts +260 -0
  3. package/cli/commands/mysqlUp.d.ts +4 -0
  4. package/cli/commands/pgConnect.d.ts +5 -0
  5. package/cli/commands/pgIntrospect.d.ts +116 -0
  6. package/cli/commands/pgPushUtils.d.ts +14 -0
  7. package/cli/commands/pgUp.d.ts +4 -0
  8. package/cli/commands/sqliteIntrospect.d.ts +102 -0
  9. package/cli/commands/sqliteUtils.d.ts +162 -0
  10. package/cli/commands/upFolders.d.ts +27 -0
  11. package/cli/commands/utils.d.ts +265 -0
  12. package/cli/selector-ui.d.ts +13 -0
  13. package/cli/utils.d.ts +11 -0
  14. package/cli/validations/common.d.ts +13 -0
  15. package/cli/validations/mysql.d.ts +365 -0
  16. package/cli/validations/outputs.d.ts +40 -0
  17. package/cli/validations/pg.d.ts +438 -0
  18. package/cli/validations/sqlite.d.ts +220 -0
  19. package/cli/validations/studio.d.ts +593 -0
  20. package/cli/views.d.ts +61 -0
  21. package/drivers/index.d.ts +25 -0
  22. package/global.d.ts +3 -0
  23. package/index.cjs +31555 -39668
  24. package/index.d.ts +48 -1
  25. package/introspect.d.ts +4 -0
  26. package/jsonDiffer.d.ts +76 -0
  27. package/jsonStatements.d.ts +349 -0
  28. package/migrationPreparator.d.ts +35 -0
  29. package/orm-extenstions/d1-driver/driver.d.ts +8 -0
  30. package/orm-extenstions/d1-driver/session.d.ts +51 -0
  31. package/orm-extenstions/d1-driver/wrangler-client.d.ts +3 -0
  32. package/package.json +9 -7
  33. package/schemaValidator.d.ts +1306 -0
  34. package/serializer/index.d.ts +9 -0
  35. package/serializer/mysqlImports.d.ts +6 -0
  36. package/serializer/mysqlSchema.d.ts +3833 -0
  37. package/serializer/mysqlSerializer.d.ts +7 -0
  38. package/serializer/pgImports.d.ts +11 -0
  39. package/serializer/pgSchema.d.ts +4244 -0
  40. package/serializer/pgSerializer.d.ts +9 -0
  41. package/serializer/sqliteImports.d.ts +5 -0
  42. package/serializer/sqliteSchema.d.ts +3227 -0
  43. package/serializer/sqliteSerializer.d.ts +8 -0
  44. package/serializer/studioUtils.d.ts +53 -0
  45. package/snapshotsDiffer.d.ts +2660 -0
  46. package/sqlgenerator.d.ts +33 -0
  47. package/sqlite-introspect.d.ts +5 -0
  48. package/utils/words.d.ts +7 -0
  49. package/utils-studio.d.ts +5 -0
  50. package/utils-studio.js +3367 -0
  51. package/utils.d.ts +212 -0
  52. package/utils.js +52590 -11754
  53. package/loader.mjs +0 -57
package/utils.d.ts ADDED
@@ -0,0 +1,212 @@
1
+ import { Dialect } from "./schemaValidator";
2
+ import { NamedWithSchema } from "./cli/commands/migrate";
3
+ import { PgDatabase } from "drizzle-orm/pg-core";
4
+ import { PgSchema as PgSchemaKit } from "./serializer/pgSchema";
5
+ import { Config, DbConnection } from ".";
6
+ export declare const assertV1OutFolder: (out: string, dialect: Dialect | "{dialect}") => void;
7
+ export type Journal = {
8
+ version: string;
9
+ dialect: Dialect;
10
+ entries: {
11
+ idx: number;
12
+ version: string;
13
+ when: number;
14
+ tag: string;
15
+ breakpoints: boolean;
16
+ }[];
17
+ };
18
+ export declare const dryJournal: (dialect: Dialect) => Journal;
19
+ export declare const snapshotsPriorV4: (out: string) => string[];
20
+ export declare function defineConfig(config: Config): Config;
21
+ export declare const prepareOutFolder: (out: string, dialect: Dialect) => {
22
+ meta: string;
23
+ snapshots: string[];
24
+ journal: any;
25
+ };
26
+ export declare const mapValues: <IN, OUT>(obj: Record<string, IN>, map: (input: IN) => OUT) => Record<string, OUT>;
27
+ export declare const validateWithReport: (snapshots: string[], dialect: Dialect) => {
28
+ malformed: string[];
29
+ nonLatest: string[];
30
+ idsMap: Record<string, {
31
+ parent: string;
32
+ snapshots: string[];
33
+ }>;
34
+ rawMap: Record<string, any>;
35
+ };
36
+ export declare const prepareMigrationFolder: (outFolder: string | undefined, dialect: Dialect) => {
37
+ snapshots: string[];
38
+ journal: any;
39
+ };
40
+ export declare const prepareMigrationMeta: (schemas: {
41
+ from: string;
42
+ to: string;
43
+ }[], tables: {
44
+ from: NamedWithSchema;
45
+ to: NamedWithSchema;
46
+ }[], columns: {
47
+ from: {
48
+ table: string;
49
+ schema: string;
50
+ column: string;
51
+ };
52
+ to: {
53
+ table: string;
54
+ schema: string;
55
+ column: string;
56
+ };
57
+ }[]) => {
58
+ schemas: {};
59
+ tables: {};
60
+ columns: {};
61
+ };
62
+ export declare const schemaRenameKey: (it: string) => string;
63
+ export declare const tableRenameKey: (it: NamedWithSchema) => string;
64
+ export declare const columnRenameKey: (table: string, schema: string, column: string) => string;
65
+ export declare const kloudMeta: () => {
66
+ pg: number[];
67
+ mysql: number[];
68
+ sqlite: number[];
69
+ };
70
+ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
71
+ left: {
72
+ internal?: {
73
+ tables: Record<string, {
74
+ columns: Record<string, {
75
+ isArray?: boolean | undefined;
76
+ dimensions?: number | undefined;
77
+ rawType?: string | undefined;
78
+ } | undefined>;
79
+ } | undefined>;
80
+ } | undefined;
81
+ id: string;
82
+ prevId: string;
83
+ version: "5";
84
+ dialect: "pg";
85
+ tables: Record<string, {
86
+ name: string;
87
+ columns: Record<string, {
88
+ isUnique?: any;
89
+ default?: any;
90
+ uniqueName?: string | undefined;
91
+ nullsNotDistinct?: boolean | undefined;
92
+ name: string;
93
+ type: string;
94
+ primaryKey: boolean;
95
+ notNull: boolean;
96
+ }>;
97
+ indexes: Record<string, {
98
+ name: string;
99
+ columns: string[];
100
+ isUnique: boolean;
101
+ }>;
102
+ foreignKeys: Record<string, {
103
+ onUpdate?: string | undefined;
104
+ onDelete?: string | undefined;
105
+ name: string;
106
+ tableFrom: string;
107
+ columnsFrom: string[];
108
+ tableTo: string;
109
+ columnsTo: string[];
110
+ }>;
111
+ schema: string;
112
+ compositePrimaryKeys: Record<string, {
113
+ name: string;
114
+ columns: string[];
115
+ }>;
116
+ uniqueConstraints: Record<string, {
117
+ name: string;
118
+ columns: string[];
119
+ nullsNotDistinct: boolean;
120
+ }>;
121
+ }>;
122
+ schemas: Record<string, string>;
123
+ _meta: {
124
+ columns: Record<string, string>;
125
+ tables: Record<string, string>;
126
+ schemas: Record<string, string>;
127
+ };
128
+ enums: Record<string, {
129
+ name: string;
130
+ values: Record<string, string>;
131
+ }>;
132
+ };
133
+ right: {
134
+ internal?: {
135
+ tables: Record<string, {
136
+ columns: Record<string, {
137
+ isArray?: boolean | undefined;
138
+ dimensions?: number | undefined;
139
+ rawType?: string | undefined;
140
+ } | undefined>;
141
+ } | undefined>;
142
+ } | undefined;
143
+ id: string;
144
+ prevId: string;
145
+ version: "5";
146
+ dialect: "pg";
147
+ tables: Record<string, {
148
+ name: string;
149
+ columns: Record<string, {
150
+ isUnique?: any;
151
+ default?: any;
152
+ uniqueName?: string | undefined;
153
+ nullsNotDistinct?: boolean | undefined;
154
+ name: string;
155
+ type: string;
156
+ primaryKey: boolean;
157
+ notNull: boolean;
158
+ }>;
159
+ indexes: Record<string, {
160
+ name: string;
161
+ columns: string[];
162
+ isUnique: boolean;
163
+ }>;
164
+ foreignKeys: Record<string, {
165
+ onUpdate?: string | undefined;
166
+ onDelete?: string | undefined;
167
+ name: string;
168
+ tableFrom: string;
169
+ columnsFrom: string[];
170
+ tableTo: string;
171
+ columnsTo: string[];
172
+ }>;
173
+ schema: string;
174
+ compositePrimaryKeys: Record<string, {
175
+ name: string;
176
+ columns: string[];
177
+ }>;
178
+ uniqueConstraints: Record<string, {
179
+ name: string;
180
+ columns: string[];
181
+ nullsNotDistinct: boolean;
182
+ }>;
183
+ }>;
184
+ schemas: Record<string, string>;
185
+ _meta: {
186
+ columns: Record<string, string>;
187
+ tables: Record<string, string>;
188
+ schemas: Record<string, string>;
189
+ };
190
+ enums: Record<string, {
191
+ name: string;
192
+ values: Record<string, string>;
193
+ }>;
194
+ };
195
+ statements: import("./jsonStatements").JsonStatement[];
196
+ sqlStatements: string[];
197
+ _meta: {
198
+ schemas: {};
199
+ tables: {};
200
+ columns: {};
201
+ } | undefined;
202
+ }>;
203
+ export type DrizzleSnapshotJSON = PgSchemaKit;
204
+ export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchemaKit;
205
+ export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
206
+ export declare const pushSchema: (imports: Record<string, unknown>, db: PgDatabase<any>) => Promise<{
207
+ hasDataLoss: boolean;
208
+ warnings: string[];
209
+ statementsToExecute: string[];
210
+ apply: () => Promise<void>;
211
+ }>;
212
+ export declare const prepareFrom: (connection: DbConnection) => Promise<Record<string, any>>;