drizzle-kit 0.19.13-e7108b7 → 0.19.13-e99bac1

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