drizzle-kit 0.20.14 → 0.20.15-13e00d1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.cjs +42737 -39937
- package/cli/commands/mysqlIntrospect.d.ts +119 -0
- package/cli/commands/mysqlPushUtils.d.ts +18 -0
- package/cli/commands/sqlitePushUtils.d.ts +21 -0
- package/drivers/index.d.ts +14 -0
- package/global.d.ts +1 -0
- package/introspect-mysql.d.ts +9 -0
- package/package.json +22 -7
- package/payload.d.mts +33 -0
- package/payload.d.ts +33 -0
- package/payload.js +36792 -0
- package/payload.mjs +36811 -0
- package/serializer/mysqlImports.d.ts +5 -0
- package/serializer/mysqlSerializer.d.ts +2 -2
- package/serializer/sqliteImports.d.ts +4 -0
- package/utils-studio.js +1 -1
- package/utils-studio.mjs +1 -1
- package/utils.d.ts +1 -15
- package/utils.js +3626 -54861
- package/utils.mjs +8062 -0
- package/cli/utils.d.ts +0 -12
- package/cli/validations/sqlite.d.ts +0 -220
- package/cli/validations/studio.d.ts +0 -593
- package/orm-extenstions/d1-driver/driver.d.ts +0 -8
- package/orm-extenstions/d1-driver/session.d.ts +0 -51
- package/orm-extenstions/d1-driver/wrangler-client.d.ts +0 -3
- package/serializer/studioUtils.d.ts +0 -65
@@ -1,4 +1,9 @@
|
|
1
1
|
import { AnyMySqlTable, MySqlSchema } from "drizzle-orm/mysql-core";
|
2
|
+
export declare const prepareFromExports: (exports: Record<string, unknown>) => {
|
3
|
+
tables: AnyMySqlTable<{}>[];
|
4
|
+
enums: any[];
|
5
|
+
schemas: MySqlSchema<string>[];
|
6
|
+
};
|
2
7
|
export declare const prepareFromMySqlImports: (imports: string[]) => Promise<{
|
3
8
|
tables: AnyMySqlTable<{}>[];
|
4
9
|
enums: any[];
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { AnyMySqlTable, MySqlSchema } from "drizzle-orm/mysql-core";
|
2
2
|
import { MySqlSchemaInternal } from "src/serializer/mysqlSchema";
|
3
|
-
import { Connection } from "mysql2/promise";
|
4
3
|
import { IntrospectStage, IntrospectStatus } from "src/cli/views";
|
4
|
+
import { DrizzleDbClient } from "src/drivers";
|
5
5
|
export declare const indexName: (tableName: string, columns: string[]) => string;
|
6
6
|
export declare const generateMySqlSnapshot: (tables: AnyMySqlTable[], enums: any[], mysqlSchemas: MySqlSchema[]) => MySqlSchemaInternal;
|
7
|
-
export declare const fromDatabase: (db:
|
7
|
+
export declare const fromDatabase: (db: DrizzleDbClient, inputSchema: string, tablesFilter?: (table: string) => boolean, progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<MySqlSchemaInternal>;
|
@@ -1,4 +1,8 @@
|
|
1
1
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
2
|
+
export declare const prepareFromExports: (exports: Record<string, unknown>) => {
|
3
|
+
tables: AnySQLiteTable<{}>[];
|
4
|
+
enums: any[];
|
5
|
+
};
|
2
6
|
export declare const prepareFromSqliteImports: (imports: string[]) => Promise<{
|
3
7
|
tables: AnySQLiteTable<{}>[];
|
4
8
|
enums: any[];
|
package/utils-studio.js
CHANGED
@@ -1631,7 +1631,7 @@ var init_pgSerializer = __esm({
|
|
1631
1631
|
END AS data_type, INFORMATION_SCHEMA.COLUMNS.table_name, INFORMATION_SCHEMA.COLUMNS.column_name, INFORMATION_SCHEMA.COLUMNS.column_default, INFORMATION_SCHEMA.COLUMNS.data_type as additional_dt
|
1632
1632
|
FROM pg_attribute a
|
1633
1633
|
JOIN INFORMATION_SCHEMA.COLUMNS ON INFORMATION_SCHEMA.COLUMNS.column_name = a.attname
|
1634
|
-
WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}'
|
1634
|
+
WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}' and INFORMATION_SCHEMA.COLUMNS.table_schema = '${tableSchema}'
|
1635
1635
|
AND a.attnum > 0
|
1636
1636
|
AND NOT a.attisdropped
|
1637
1637
|
ORDER BY a.attnum;`
|
package/utils-studio.mjs
CHANGED
@@ -1640,7 +1640,7 @@ var init_pgSerializer = __esm({
|
|
1640
1640
|
END AS data_type, INFORMATION_SCHEMA.COLUMNS.table_name, INFORMATION_SCHEMA.COLUMNS.column_name, INFORMATION_SCHEMA.COLUMNS.column_default, INFORMATION_SCHEMA.COLUMNS.data_type as additional_dt
|
1641
1641
|
FROM pg_attribute a
|
1642
1642
|
JOIN INFORMATION_SCHEMA.COLUMNS ON INFORMATION_SCHEMA.COLUMNS.column_name = a.attname
|
1643
|
-
WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}'
|
1643
|
+
WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}' and INFORMATION_SCHEMA.COLUMNS.table_schema = '${tableSchema}'
|
1644
1644
|
AND a.attnum > 0
|
1645
1645
|
AND NOT a.attisdropped
|
1646
1646
|
ORDER BY a.attnum;`
|
package/utils.d.ts
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
import { Dialect } from "./schemaValidator";
|
1
|
+
import type { Dialect } from "./schemaValidator";
|
2
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 { DbConnection } from ".";
|
6
3
|
export declare const assertV1OutFolder: (out: string, dialect: Dialect | "{dialect}") => void;
|
7
4
|
export type Journal = {
|
8
5
|
version: string;
|
@@ -22,7 +19,6 @@ export declare const prepareOutFolder: (out: string, dialect: Dialect) => {
|
|
22
19
|
snapshots: string[];
|
23
20
|
journal: any;
|
24
21
|
};
|
25
|
-
export declare const mapValues: <IN, OUT>(obj: Record<string, IN>, map: (input: IN) => OUT) => Record<string, OUT>;
|
26
22
|
export declare const validateWithReport: (snapshots: string[], dialect: Dialect) => {
|
27
23
|
malformed: string[];
|
28
24
|
nonLatest: string[];
|
@@ -201,13 +197,3 @@ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
|
|
201
197
|
columns: {};
|
202
198
|
} | undefined;
|
203
199
|
}>;
|
204
|
-
export type DrizzleSnapshotJSON = PgSchemaKit;
|
205
|
-
export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchemaKit;
|
206
|
-
export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
207
|
-
export declare const pushSchema: (imports: Record<string, unknown>, db: PgDatabase<any>) => Promise<{
|
208
|
-
hasDataLoss: boolean;
|
209
|
-
warnings: string[];
|
210
|
-
statementsToExecute: string[];
|
211
|
-
apply: () => Promise<void>;
|
212
|
-
}>;
|
213
|
-
export declare const prepareFrom: (connection: DbConnection) => Promise<Record<string, any>>;
|