drizzle-kit 0.20.16 → 0.20.17-0d9aa5f

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.
Files changed (58) hide show
  1. package/bin.cjs +69120 -38874
  2. package/cli/commands/migrate.d.ts +123 -106
  3. package/cli/commands/mysqlIntrospect.d.ts +2 -71
  4. package/cli/commands/mysqlPushUtils.d.ts +4 -8
  5. package/cli/commands/pgIntrospect.d.ts +6 -70
  6. package/cli/commands/pgPushUtils.d.ts +3 -6
  7. package/cli/commands/sqliteIntrospect.d.ts +13 -17
  8. package/cli/commands/sqlitePushUtils.d.ts +4 -10
  9. package/cli/commands/utils.d.ts +39 -255
  10. package/cli/connections.d.ts +13 -0
  11. package/cli/utils.d.ts +13 -0
  12. package/cli/validations/cli.d.ts +169 -0
  13. package/cli/validations/common.d.ts +208 -7
  14. package/cli/validations/mysql.d.ts +6 -342
  15. package/cli/validations/outputs.d.ts +2 -0
  16. package/cli/validations/pg.d.ts +16 -408
  17. package/cli/validations/sqlite.d.ts +22 -0
  18. package/cli/views.d.ts +7 -5
  19. package/global.d.ts +3 -1
  20. package/index.d.mts +25 -17
  21. package/index.d.ts +25 -17
  22. package/index.js +1 -0
  23. package/introspect-sqlite.d.ts +2 -2
  24. package/jsonDiffer.d.ts +14 -29
  25. package/jsonStatements.d.ts +38 -11
  26. package/package.json +28 -51
  27. package/payload.d.mts +5 -5
  28. package/payload.d.ts +5 -5
  29. package/payload.js +16621 -33841
  30. package/payload.mjs +16673 -33904
  31. package/schemaValidator.d.ts +72 -69
  32. package/serializer/mysqlImports.d.ts +3 -7
  33. package/serializer/mysqlSchema.d.ts +1404 -587
  34. package/serializer/mysqlSerializer.d.ts +6 -6
  35. package/serializer/pgImports.d.ts +2 -2
  36. package/serializer/pgSchema.d.ts +1260 -801
  37. package/serializer/pgSerializer.d.ts +2 -2
  38. package/serializer/sqliteImports.d.ts +2 -4
  39. package/serializer/sqliteSchema.d.ts +144 -570
  40. package/serializer/sqliteSerializer.d.ts +4 -4
  41. package/serializer/studio.d.ts +51 -0
  42. package/snapshotsDiffer.d.ts +2334 -1057
  43. package/utils/words.d.ts +1 -1
  44. package/utils-studio.d.mts +0 -1
  45. package/utils-studio.d.ts +0 -1
  46. package/utils-studio.js +3817 -169
  47. package/utils-studio.mjs +3817 -172
  48. package/utils.d.ts +20 -141
  49. package/utils.js +3899 -7070
  50. package/utils.mjs +3972 -7143
  51. package/cli/commands/mysqlUp.d.ts +0 -4
  52. package/cli/commands/pgConnect.d.ts +0 -5
  53. package/cli/commands/pgUp.d.ts +0 -4
  54. package/cli/commands/sqliteUtils.d.ts +0 -162
  55. package/cli/commands/upFolders.d.ts +0 -27
  56. package/drivers/index.d.ts +0 -39
  57. package/introspect-mysql.d.ts +0 -9
  58. package/introspect-pg.d.ts +0 -12
@@ -1,6 +1,6 @@
1
1
  import type { SQLiteSchemaInternal } from "../serializer/sqliteSchema";
2
2
  import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
3
- import type { IntrospectStage, IntrospectStatus } from "src/cli/views";
4
- import type { DrizzleDbClient } from "src/drivers";
5
- export declare const generateSqliteSnapshot: (tables: AnySQLiteTable[], enums: any[]) => SQLiteSchemaInternal;
6
- export declare const fromDatabase: (db: DrizzleDbClient, tablesFilter?: (table: string) => boolean, progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<SQLiteSchemaInternal>;
3
+ import type { IntrospectStage, IntrospectStatus } from "../cli/views";
4
+ import type { SQLiteDB } from "../utils";
5
+ export declare const generateSqliteSnapshot: (tables: AnySQLiteTable[]) => SQLiteSchemaInternal;
6
+ export declare const fromDatabase: (db: SQLiteDB, tablesFilter?: (table: string) => boolean, progressCallback?: (stage: IntrospectStage, count: number, status: IntrospectStatus) => void) => Promise<SQLiteSchemaInternal>;
@@ -0,0 +1,51 @@
1
+ import { Hono } from "hono";
2
+ import type { PostgresCredentials } from "../cli/validations/pg";
3
+ import type { MysqlCredentials } from "../cli/validations/mysql";
4
+ import type { SqliteCredentials } from "../cli/validations/sqlite";
5
+ import { AnyPgTable } from "drizzle-orm/pg-core";
6
+ import { Relations } from "drizzle-orm";
7
+ import { AnyMySqlTable } from "drizzle-orm/mysql-core";
8
+ import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
9
+ type CustomDefault = {
10
+ schema: string;
11
+ table: string;
12
+ column: string;
13
+ func: () => unknown;
14
+ };
15
+ export type Setup = {
16
+ dialect: "pg" | "mysql" | "sqlite";
17
+ proxy: (params: ProxyParams) => Promise<any[] | any>;
18
+ customDefaults: CustomDefault[];
19
+ };
20
+ export type ProxyParams = {
21
+ sql: string;
22
+ params: any[];
23
+ mode: "array" | "object";
24
+ method: "values" | "get" | "all" | "run" | "execute";
25
+ };
26
+ export declare const preparePgSchema: (path: string | string[]) => Promise<{
27
+ schema: Record<string, Record<string, AnyPgTable>>;
28
+ relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
29
+ }>;
30
+ export declare const prepareMySqlSchema: (path: string | string[]) => Promise<{
31
+ schema: Record<string, Record<string, AnyMySqlTable>>;
32
+ relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
33
+ }>;
34
+ export declare const prepareSQLiteSchema: (path: string | string[]) => Promise<{
35
+ schema: Record<string, Record<string, AnySQLiteTable>>;
36
+ relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
37
+ }>;
38
+ export declare const drizzleForPostgres: (credentials: PostgresCredentials, pgSchema: Record<string, Record<string, AnyPgTable>>, relations: Record<string, Relations>) => Promise<Setup>;
39
+ export declare const drizzleForMySQL: (credentials: MysqlCredentials, mysqlSchema: Record<string, Record<string, AnyMySqlTable>>, relations: Record<string, Relations>) => Promise<Setup>;
40
+ export declare const drizzleForSQLite: (credentials: SqliteCredentials, sqliteSchema: Record<string, Record<string, AnySQLiteTable>>, relations: Record<string, Relations>) => Promise<Setup>;
41
+ export type Server = {
42
+ start: (params: {
43
+ host: string;
44
+ port: number;
45
+ key?: string;
46
+ cert?: string;
47
+ cb: (err: Error | null, address: string) => void;
48
+ }) => void;
49
+ };
50
+ export declare const prepareServer: ({ dialect, proxy, customDefaults }: Setup, app?: Hono) => Promise<Server>;
51
+ export {};