drizzle-kit 0.19.14-039355d → 0.20.0-5198fb7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) 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/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 +40 -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 +548 -0
  18. package/cli/views.d.ts +61 -0
  19. package/drivers/index.d.ts +25 -0
  20. package/global.d.ts +2 -0
  21. package/index.cjs +28813 -37075
  22. package/index.d.ts +47 -0
  23. package/introspect.d.ts +4 -0
  24. package/jsonDiffer.d.ts +76 -0
  25. package/jsonStatements.d.ts +349 -0
  26. package/migrationPreparator.d.ts +35 -0
  27. package/orm-extenstions/d1-driver/driver.d.ts +8 -0
  28. package/orm-extenstions/d1-driver/session.d.ts +52 -0
  29. package/orm-extenstions/d1-driver/wrangler-client.d.ts +3 -0
  30. package/package.json +4 -3
  31. package/schemaValidator.d.ts +1306 -0
  32. package/serializer/index.d.ts +9 -0
  33. package/serializer/mysqlImports.d.ts +6 -0
  34. package/serializer/mysqlSchema.d.ts +3833 -0
  35. package/serializer/mysqlSerializer.d.ts +7 -0
  36. package/serializer/pgImports.d.ts +11 -0
  37. package/serializer/pgSchema.d.ts +4244 -0
  38. package/serializer/pgSerializer.d.ts +7 -0
  39. package/serializer/sqliteImports.d.ts +5 -0
  40. package/serializer/sqliteSchema.d.ts +3227 -0
  41. package/serializer/sqliteSerializer.d.ts +8 -0
  42. package/serializer/studioUtils.d.ts +35 -0
  43. package/snapshotsDiffer.d.ts +2660 -0
  44. package/sqlgenerator.d.ts +33 -0
  45. package/sqlite-introspect.d.ts +5 -0
  46. package/utils/words.d.ts +7 -0
  47. package/utils.d.ts +33 -0
  48. package/utils.js +51597 -11732
  49. package/utilsR.d.ts +232 -0
package/utilsR.d.ts ADDED
@@ -0,0 +1,232 @@
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 { Config, 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 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<{
213
+ db: import("drizzle-orm/node-postgres").NodePgDatabase<Record<string, never>>;
214
+ type: "pg";
215
+ schema: Record<string, AnyPgTable<{}> | import("drizzle-orm").Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
216
+ } | {
217
+ db: import("drizzle-orm/mysql2").MySql2Database<Record<string, never>>;
218
+ type: "mysql";
219
+ schema: Record<string, import("drizzle-orm/mysql-core").AnyMySqlTable<{}> | import("drizzle-orm").Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
220
+ } | {
221
+ db: import("./orm-extenstions/d1-driver/driver").DrizzleD1WranglerDatabase<Record<string, never>>;
222
+ type: "sqlite";
223
+ schema: Record<string, import("drizzle-orm/sqlite-core").AnySQLiteTable<{}> | import("drizzle-orm").Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
224
+ } | {
225
+ db: import("drizzle-orm/better-sqlite3").BetterSQLite3Database<Record<string, never>>;
226
+ type: "sqlite";
227
+ schema: Record<string, import("drizzle-orm/sqlite-core").AnySQLiteTable<{}> | import("drizzle-orm").Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
228
+ } | {
229
+ db: import("drizzle-orm/libsql").LibSQLDatabase<Record<string, never>>;
230
+ type: "sqlite";
231
+ schema: Record<string, import("drizzle-orm/sqlite-core").AnySQLiteTable<{}> | import("drizzle-orm").Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
232
+ }>;