drizzle-kit 0.20.0-5198fb7 → 0.20.0-572b8ee

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts CHANGED
@@ -99,6 +99,7 @@ export type Config = {
99
99
  driver: "d1";
100
100
  dbCredentials: {
101
101
  wranglerConfigPath: string;
102
+ dbName: string;
102
103
  };
103
104
  } | {});
104
105
  export declare function defineConfig(config: Config): Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.0-5198fb7",
3
+ "version": "0.20.0-572b8ee",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  ]
55
55
  },
56
56
  "dependencies": {
57
- "@drizzle-team/studio": "^0.0.5",
57
+ "@drizzle-team/studio": "^0.0.9",
58
58
  "@esbuild-kit/esm-loader": "^2.5.5",
59
59
  "camelcase": "^7.0.1",
60
60
  "chalk": "^5.2.0",
@@ -1,7 +1,7 @@
1
- import { PgSchemaInternal } from "./pgSchema";
2
- import { SQLiteSchemaInternal } from "./sqliteSchema";
3
- import { MySqlSchemaInternal } from "./mysqlSchema";
4
- import { SQL } from "drizzle-orm";
1
+ import type { PgSchemaInternal } from "./pgSchema";
2
+ import type { SQLiteSchemaInternal } from "./sqliteSchema";
3
+ import type { MySqlSchemaInternal } from "./mysqlSchema";
4
+ import type { SQL } from "drizzle-orm";
5
5
  export declare const sqlToStr: (sql: SQL) => string;
6
6
  export declare const serializeMySql: (path: string | string[]) => Promise<MySqlSchemaInternal>;
7
7
  export declare const serializePg: (path: string | string[], schemaFilter?: string[]) => Promise<PgSchemaInternal>;
@@ -171,24 +171,24 @@ export declare const pgSchemaV1: import("zod").ZodObject<{
171
171
  }, "strict", import("zod").ZodTypeAny, {
172
172
  onUpdate?: string | undefined;
173
173
  onDelete?: string | undefined;
174
- column: string;
175
174
  foreignKeyName: string;
176
175
  table: string;
176
+ column: string;
177
177
  }, {
178
178
  onUpdate?: string | undefined;
179
179
  onDelete?: string | undefined;
180
- column: string;
181
180
  foreignKeyName: string;
182
181
  table: string;
182
+ column: string;
183
183
  }>>;
184
184
  }, "strict", import("zod").ZodTypeAny, {
185
185
  default?: any;
186
186
  references?: {
187
187
  onUpdate?: string | undefined;
188
188
  onDelete?: string | undefined;
189
- column: string;
190
189
  foreignKeyName: string;
191
190
  table: string;
191
+ column: string;
192
192
  } | undefined;
193
193
  name: string;
194
194
  type: string;
@@ -199,9 +199,9 @@ export declare const pgSchemaV1: import("zod").ZodObject<{
199
199
  references?: {
200
200
  onUpdate?: string | undefined;
201
201
  onDelete?: string | undefined;
202
- column: string;
203
202
  foreignKeyName: string;
204
203
  table: string;
204
+ column: string;
205
205
  } | undefined;
206
206
  name: string;
207
207
  type: string;
@@ -238,9 +238,9 @@ export declare const pgSchemaV1: import("zod").ZodObject<{
238
238
  references?: {
239
239
  onUpdate?: string | undefined;
240
240
  onDelete?: string | undefined;
241
- column: string;
242
241
  foreignKeyName: string;
243
242
  table: string;
243
+ column: string;
244
244
  } | undefined;
245
245
  name: string;
246
246
  type: string;
@@ -261,9 +261,9 @@ export declare const pgSchemaV1: import("zod").ZodObject<{
261
261
  references?: {
262
262
  onUpdate?: string | undefined;
263
263
  onDelete?: string | undefined;
264
- column: string;
265
264
  foreignKeyName: string;
266
265
  table: string;
266
+ column: string;
267
267
  } | undefined;
268
268
  name: string;
269
269
  type: string;
@@ -297,9 +297,9 @@ export declare const pgSchemaV1: import("zod").ZodObject<{
297
297
  references?: {
298
298
  onUpdate?: string | undefined;
299
299
  onDelete?: string | undefined;
300
- column: string;
301
300
  foreignKeyName: string;
302
301
  table: string;
302
+ column: string;
303
303
  } | undefined;
304
304
  name: string;
305
305
  type: string;
@@ -327,9 +327,9 @@ export declare const pgSchemaV1: import("zod").ZodObject<{
327
327
  references?: {
328
328
  onUpdate?: string | undefined;
329
329
  onDelete?: string | undefined;
330
- column: string;
331
330
  foreignKeyName: string;
332
331
  table: string;
332
+ column: string;
333
333
  } | undefined;
334
334
  name: string;
335
335
  type: string;
@@ -3059,24 +3059,24 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
3059
3059
  }, "strict", import("zod").ZodTypeAny, {
3060
3060
  onUpdate?: string | undefined;
3061
3061
  onDelete?: string | undefined;
3062
- column: string;
3063
3062
  foreignKeyName: string;
3064
3063
  table: string;
3064
+ column: string;
3065
3065
  }, {
3066
3066
  onUpdate?: string | undefined;
3067
3067
  onDelete?: string | undefined;
3068
- column: string;
3069
3068
  foreignKeyName: string;
3070
3069
  table: string;
3070
+ column: string;
3071
3071
  }>>;
3072
3072
  }, "strict", import("zod").ZodTypeAny, {
3073
3073
  default?: any;
3074
3074
  references?: {
3075
3075
  onUpdate?: string | undefined;
3076
3076
  onDelete?: string | undefined;
3077
- column: string;
3078
3077
  foreignKeyName: string;
3079
3078
  table: string;
3079
+ column: string;
3080
3080
  } | undefined;
3081
3081
  name: string;
3082
3082
  type: string;
@@ -3087,9 +3087,9 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
3087
3087
  references?: {
3088
3088
  onUpdate?: string | undefined;
3089
3089
  onDelete?: string | undefined;
3090
- column: string;
3091
3090
  foreignKeyName: string;
3092
3091
  table: string;
3092
+ column: string;
3093
3093
  } | undefined;
3094
3094
  name: string;
3095
3095
  type: string;
@@ -3126,9 +3126,9 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
3126
3126
  references?: {
3127
3127
  onUpdate?: string | undefined;
3128
3128
  onDelete?: string | undefined;
3129
- column: string;
3130
3129
  foreignKeyName: string;
3131
3130
  table: string;
3131
+ column: string;
3132
3132
  } | undefined;
3133
3133
  name: string;
3134
3134
  type: string;
@@ -3149,9 +3149,9 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
3149
3149
  references?: {
3150
3150
  onUpdate?: string | undefined;
3151
3151
  onDelete?: string | undefined;
3152
- column: string;
3153
3152
  foreignKeyName: string;
3154
3153
  table: string;
3154
+ column: string;
3155
3155
  } | undefined;
3156
3156
  name: string;
3157
3157
  type: string;
@@ -3185,9 +3185,9 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
3185
3185
  references?: {
3186
3186
  onUpdate?: string | undefined;
3187
3187
  onDelete?: string | undefined;
3188
- column: string;
3189
3188
  foreignKeyName: string;
3190
3189
  table: string;
3190
+ column: string;
3191
3191
  } | undefined;
3192
3192
  name: string;
3193
3193
  type: string;
@@ -3215,9 +3215,9 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
3215
3215
  references?: {
3216
3216
  onUpdate?: string | undefined;
3217
3217
  onDelete?: string | undefined;
3218
- column: string;
3219
3218
  foreignKeyName: string;
3220
3219
  table: string;
3220
+ column: string;
3221
3221
  } | undefined;
3222
3222
  name: string;
3223
3223
  type: string;
@@ -1,7 +1,9 @@
1
1
  import { AnyPgTable, PgEnum, PgSchema } from "drizzle-orm/pg-core";
2
- import { IntrospectStage, IntrospectStatus } from "src/cli/views";
3
- import { PgSchemaInternal } from "src/serializer/pgSchema";
4
- import { DrizzleDbClient } from "src/drivers";
2
+ import { Relations } from "drizzle-orm";
3
+ import type { IntrospectStage, IntrospectStatus } from "../cli/views";
4
+ import type { PgSchemaInternal } from "../serializer/pgSchema";
5
+ import type { DrizzleDbClient } from "../drivers";
5
6
  export declare const indexName: (tableName: string, columns: string[]) => string;
6
7
  export declare const generatePgSnapshot: (tables: AnyPgTable[], enums: PgEnum<any>[], schemas: PgSchema[], schemaFilter?: string[]) => PgSchemaInternal;
7
8
  export declare const fromDatabase: (db: DrizzleDbClient, tablesFilter: ((table: string) => boolean) | undefined, schemaFilters: string[], progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<PgSchemaInternal>;
9
+ export declare const toDrizzle: (schema: PgSchemaInternal, schemaName: string) => Record<string, AnyPgTable | Relations>;
@@ -1,8 +1,8 @@
1
- import { SQLiteSchemaInternal } from "src/serializer/sqliteSchema";
1
+ import type { SQLiteSchemaInternal } from "../serializer/sqliteSchema";
2
2
  import { Relations } from "drizzle-orm";
3
3
  import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
4
- import { IntrospectStage, IntrospectStatus } from "src/cli/views";
5
- import { DrizzleDbClient } from "src/drivers";
4
+ import type { IntrospectStage, IntrospectStatus } from "src/cli/views";
5
+ import type { DrizzleDbClient } from "src/drivers";
6
6
  export declare const generateSqliteSnapshot: (tables: AnySQLiteTable[], enums: any[]) => SQLiteSchemaInternal;
7
7
  export declare const fromDatabase: (db: DrizzleDbClient, tablesFilter?: (table: string) => boolean, progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<SQLiteSchemaInternal>;
8
8
  export declare const toDrizzle: (schema: SQLiteSchemaInternal) => Record<string, AnySQLiteTable | Relations>;
@@ -2,17 +2,18 @@ import { Relations } from "drizzle-orm";
2
2
  import { AnyMySqlTable } from "drizzle-orm/mysql-core";
3
3
  import { AnyPgTable } from "drizzle-orm/pg-core";
4
4
  import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
5
+ import type { Pool } from "pg";
5
6
  import { StudioConfigConnections } from "src/cli/validations/studio";
6
7
  export declare const prepareModels: (path: string | string[]) => Promise<{
7
8
  pgSchema: Record<string, AnyPgTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
8
9
  mysqlSchema: Record<string, AnyMySqlTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
9
- sqliteSchema: Record<string, AnySQLiteTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
10
+ sqliteSchema: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>> | AnySQLiteTable<{}>>;
10
11
  }>;
11
12
  export declare const drizzleDb: (drizzleConfig: StudioConfigConnections, models: {
12
13
  pgSchema?: Record<string, AnyPgTable | Relations>;
13
14
  mysqlSchema?: Record<string, AnyMySqlTable | Relations>;
14
15
  sqliteSchema?: Record<string, AnySQLiteTable | Relations>;
15
- }, logger: boolean) => Promise<{
16
+ }, logger: boolean, pgClient?: Pool) => Promise<{
16
17
  db: import("drizzle-orm/node-postgres").NodePgDatabase<Record<string, never>>;
17
18
  type: "pg";
18
19
  schema: Record<string, AnyPgTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
@@ -23,13 +24,13 @@ export declare const drizzleDb: (drizzleConfig: StudioConfigConnections, models:
23
24
  } | {
24
25
  db: import("../orm-extenstions/d1-driver/driver").DrizzleD1WranglerDatabase<Record<string, never>>;
25
26
  type: "sqlite";
26
- schema: Record<string, AnySQLiteTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
27
+ schema: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>> | AnySQLiteTable<{}>> | undefined;
27
28
  } | {
28
29
  db: import("drizzle-orm/better-sqlite3").BetterSQLite3Database<Record<string, never>>;
29
30
  type: "sqlite";
30
- schema: Record<string, AnySQLiteTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
31
+ schema: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>> | AnySQLiteTable<{}>> | undefined;
31
32
  } | {
32
33
  db: import("drizzle-orm/libsql").LibSQLDatabase<Record<string, never>>;
33
34
  type: "sqlite";
34
- schema: Record<string, AnySQLiteTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
35
+ schema: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>> | AnySQLiteTable<{}>> | undefined;
35
36
  }>;
@@ -1,5 +1,5 @@
1
1
  import "./@types/utils";
2
- import { ConfigIntrospectCasing } from "./cli/commands/utils";
3
- import { SQLiteSchema } from "./serializer/sqliteSchema";
2
+ import type { ConfigIntrospectCasing } from "./cli/commands/utils";
3
+ import type { SQLiteSchema } from "./serializer/sqliteSchema";
4
4
  export declare const indexName: (tableName: string, columns: string[]) => string;
5
5
  export declare const schemaToTypeScript: (schema: SQLiteSchema, casing: ConfigIntrospectCasing["casing"]) => string;
@@ -0,0 +1,5 @@
1
+ export { toDrizzle as drizzleSchemaPg } from "./serializer/pgSerializer";
2
+ export { toDrizzle as drizzleSchemaSQLite } from "./serializer/sqliteSerializer";
3
+ export { sqlitePushIntrospect } from "./cli/commands/sqliteIntrospect";
4
+ export { pgPushIntrospect } from "./cli/commands/pgIntrospect";
5
+ export { DrizzleORMPgClient } from "./drivers";