drizzle-kit 0.19.13-a511135 → 0.19.13-aeb7ac9
Sign up to get free protection for your applications and to get access to all the features.
- package/index.cjs +30671 -30644
- package/index.d.ts +14 -15
- package/package.json +3 -4
- package/utils.js +11724 -44481
- package/@types/utils.d.ts +0 -12
- package/cli/commands/migrate.d.ts +0 -141
- package/cli/commands/mysqlUp.d.ts +0 -4
- package/cli/commands/pgIntrospect.d.ts +0 -118
- package/cli/commands/pgPushUtils.d.ts +0 -14
- package/cli/commands/pgUp.d.ts +0 -4
- package/cli/commands/sqliteIntrospect.d.ts +0 -102
- package/cli/commands/sqliteUtils.d.ts +0 -162
- package/cli/commands/upFolders.d.ts +0 -27
- package/cli/commands/utils.d.ts +0 -265
- package/cli/selector-ui.d.ts +0 -13
- package/cli/validations/common.d.ts +0 -13
- package/cli/validations/mysql.d.ts +0 -414
- package/cli/validations/outputs.d.ts +0 -39
- package/cli/validations/pg.d.ts +0 -438
- package/cli/validations/sqlite.d.ts +0 -220
- package/cli/validations/studio.d.ts +0 -469
- package/cli/views.d.ts +0 -61
- package/drivers/index.d.ts +0 -26
- package/global.d.ts +0 -2
- package/introspect.d.ts +0 -4
- package/jsonDiffer.d.ts +0 -76
- package/jsonStatements.d.ts +0 -349
- package/migrationPreparator.d.ts +0 -35
- package/schemaValidator.d.ts +0 -1236
- package/serializer/index.d.ts +0 -9
- package/serializer/mysqlImports.d.ts +0 -6
- package/serializer/mysqlSchema.d.ts +0 -3833
- package/serializer/mysqlSerializer.d.ts +0 -7
- package/serializer/pgImports.d.ts +0 -11
- package/serializer/pgSchema.d.ts +0 -4000
- package/serializer/pgSerializer.d.ts +0 -7
- package/serializer/sqliteImports.d.ts +0 -5
- package/serializer/sqliteSchema.d.ts +0 -3162
- package/serializer/sqliteSerializer.d.ts +0 -8
- package/serializer/studioUtils.d.ts +0 -31
- package/snapshotsDiffer.d.ts +0 -2660
- package/sqlgenerator.d.ts +0 -33
- package/sqlite-introspect.d.ts +0 -5
- package/utils/words.d.ts +0 -7
- package/utils.d.ts +0 -32
- package/utilsR.d.ts +0 -209
package/sqlgenerator.d.ts
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
import { JsonCreateIndexStatement, JsonDropIndexStatement, JsonDropTableStatement, JsonRenameTableStatement, JsonSqliteAddColumnStatement, JsonSqliteCreateTableStatement, JsonStatement } from "./jsonStatements";
|
2
|
-
import { Dialect } from "./schemaValidator";
|
3
|
-
export declare const pgNativeTypes: Set<string>;
|
4
|
-
declare abstract class Convertor {
|
5
|
-
abstract can(statement: JsonStatement, dialect: Dialect): boolean;
|
6
|
-
abstract convert(statement: JsonStatement): string;
|
7
|
-
}
|
8
|
-
export declare class SQLiteCreateTableConvertor extends Convertor {
|
9
|
-
can(statement: JsonStatement, dialect: Dialect): boolean;
|
10
|
-
convert(st: JsonSqliteCreateTableStatement): string;
|
11
|
-
}
|
12
|
-
export declare class SQLiteDropTableConvertor extends Convertor {
|
13
|
-
can(statement: JsonStatement, dialect: Dialect): boolean;
|
14
|
-
convert(statement: JsonDropTableStatement): string;
|
15
|
-
}
|
16
|
-
export declare class SqliteRenameTableConvertor extends Convertor {
|
17
|
-
can(statement: JsonStatement, dialect: Dialect): boolean;
|
18
|
-
convert(statement: JsonRenameTableStatement): string;
|
19
|
-
}
|
20
|
-
export declare class SQLiteAlterTableAddColumnConvertor extends Convertor {
|
21
|
-
can(statement: JsonStatement, dialect: Dialect): boolean;
|
22
|
-
convert(statement: JsonSqliteAddColumnStatement): string;
|
23
|
-
}
|
24
|
-
export declare class CreateSqliteIndexConvertor extends Convertor {
|
25
|
-
can(statement: JsonStatement, dialect: Dialect): boolean;
|
26
|
-
convert(statement: JsonCreateIndexStatement): string;
|
27
|
-
}
|
28
|
-
export declare class SqliteDropIndexConvertor extends Convertor {
|
29
|
-
can(statement: JsonStatement, dialect: Dialect): boolean;
|
30
|
-
convert(statement: JsonDropIndexStatement): string;
|
31
|
-
}
|
32
|
-
export declare const fromJson: (statements: JsonStatement[], dialect: Dialect) => string[];
|
33
|
-
export {};
|
package/sqlite-introspect.d.ts
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
import "./@types/utils";
|
2
|
-
import { ConfigIntrospectCasing } from "./cli/commands/utils";
|
3
|
-
import { SQLiteSchema } from "./serializer/sqliteSchema";
|
4
|
-
export declare const indexName: (tableName: string, columns: string[]) => string;
|
5
|
-
export declare const schemaToTypeScript: (schema: SQLiteSchema, casing: ConfigIntrospectCasing["casing"]) => string;
|
package/utils/words.d.ts
DELETED
package/utils.d.ts
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
import { AnyMySqlTable } from "drizzle-orm/mysql-core";
|
2
|
-
import { Relations } from "drizzle-orm";
|
3
|
-
import { AnyPgTable, PgDatabase } from "drizzle-orm/pg-core";
|
4
|
-
import { DbConnection } from ".";
|
5
|
-
import { PgSchema } from "./serializer/pgSchema";
|
6
|
-
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
7
|
-
export type DrizzleSnapshotJSON = PgSchema;
|
8
|
-
export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => DrizzleSnapshotJSON;
|
9
|
-
export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
10
|
-
export declare const pushSchema: (imports: Record<string, unknown>, db: PgDatabase<any>) => Promise<{
|
11
|
-
hasDataLoss: boolean;
|
12
|
-
warnings: string[];
|
13
|
-
statementsToExecute: string[];
|
14
|
-
apply: () => Promise<void>;
|
15
|
-
}>;
|
16
|
-
export declare const prepareFrom: (connection: DbConnection) => Promise<{
|
17
|
-
db: import("drizzle-orm/node-postgres").NodePgDatabase<Record<string, never>>;
|
18
|
-
type: "pg";
|
19
|
-
schema: Record<string, AnyPgTable<{}> | Relations>;
|
20
|
-
} | {
|
21
|
-
db: import("drizzle-orm/mysql2").MySql2Database<Record<string, never>>;
|
22
|
-
type: "mysql";
|
23
|
-
schema: Record<string, AnyMySqlTable<{}> | Relations>;
|
24
|
-
} | {
|
25
|
-
db: import("drizzle-orm/better-sqlite3").BetterSQLite3Database<Record<string, never>>;
|
26
|
-
type: "sqlite";
|
27
|
-
schema: Record<string, AnySQLiteTable<{}> | Relations>;
|
28
|
-
} | {
|
29
|
-
db: import("drizzle-orm/libsql").LibSQLDatabase<Record<string, never>>;
|
30
|
-
type: "sqlite";
|
31
|
-
schema: Record<string, AnySQLiteTable<{}> | Relations>;
|
32
|
-
}>;
|
package/utilsR.d.ts
DELETED
@@ -1,209 +0,0 @@
|
|
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
|
-
}>;
|