drizzle-kit 0.20.17-c347d7b → 0.20.17-c50cacb

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/bin.cjs +8046 -1215
  2. package/index.d.mts +25 -13
  3. package/index.d.ts +25 -13
  4. package/package.json +5 -16
  5. package/payload.d.mts +987 -18
  6. package/payload.d.ts +987 -18
  7. package/payload.js +19076 -16849
  8. package/payload.mjs +19093 -16841
  9. package/utils-studio.js +9 -6
  10. package/utils-studio.mjs +9 -6
  11. package/utils.js +8 -5
  12. package/utils.mjs +8 -5
  13. package/@types/utils.d.ts +0 -13
  14. package/cli/commands/migrate.d.ts +0 -287
  15. package/cli/commands/mysqlIntrospect.d.ts +0 -50
  16. package/cli/commands/mysqlPushUtils.d.ts +0 -14
  17. package/cli/commands/pgIntrospect.d.ts +0 -59
  18. package/cli/commands/pgPushUtils.d.ts +0 -11
  19. package/cli/commands/sqliteIntrospect.d.ts +0 -103
  20. package/cli/commands/sqlitePushUtils.d.ts +0 -15
  21. package/cli/commands/utils.d.ts +0 -180
  22. package/cli/connections.d.ts +0 -18
  23. package/cli/selector-ui.d.ts +0 -13
  24. package/cli/utils.d.ts +0 -13
  25. package/cli/validations/cli.d.ts +0 -169
  26. package/cli/validations/common.d.ts +0 -214
  27. package/cli/validations/mysql.d.ts +0 -29
  28. package/cli/validations/outputs.d.ts +0 -41
  29. package/cli/validations/pg.d.ts +0 -46
  30. package/cli/validations/sqlite.d.ts +0 -22
  31. package/cli/validations/studio.d.ts +0 -92
  32. package/cli/views.d.ts +0 -70
  33. package/global.d.ts +0 -6
  34. package/introspect-sqlite.d.ts +0 -10
  35. package/jsonDiffer.d.ts +0 -61
  36. package/jsonStatements.d.ts +0 -376
  37. package/migrationPreparator.d.ts +0 -35
  38. package/schemaValidator.d.ts +0 -1316
  39. package/serializer/index.d.ts +0 -9
  40. package/serializer/mysqlImports.d.ts +0 -7
  41. package/serializer/mysqlSchema.d.ts +0 -4650
  42. package/serializer/mysqlSerializer.d.ts +0 -7
  43. package/serializer/pgImports.d.ts +0 -11
  44. package/serializer/pgSchema.d.ts +0 -4792
  45. package/serializer/pgSerializer.d.ts +0 -7
  46. package/serializer/schemaToDrizzle.d.ts +0 -7
  47. package/serializer/sqliteImports.d.ts +0 -7
  48. package/serializer/sqliteSchema.d.ts +0 -2801
  49. package/serializer/sqliteSerializer.d.ts +0 -6
  50. package/serializer/studio.d.ts +0 -53
  51. package/snapshotsDiffer.d.ts +0 -3936
  52. package/sqlgenerator.d.ts +0 -33
  53. package/utils/words.d.ts +0 -7
  54. package/utils-studio.d.mts +0 -4
  55. package/utils-studio.d.ts +0 -4
  56. package/utils.d.ts +0 -78
@@ -1,29 +0,0 @@
1
- import { TypeOf } from "zod";
2
- export declare const mysqlCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
3
- host: import("zod").ZodString;
4
- port: import("zod").ZodOptional<import("zod").ZodNumber>;
5
- user: import("zod").ZodDefault<import("zod").ZodString>;
6
- password: import("zod").ZodOptional<import("zod").ZodString>;
7
- database: import("zod").ZodString;
8
- }, "strip", import("zod").ZodTypeAny, {
9
- host: string;
10
- user: string;
11
- database: string;
12
- port?: number | undefined;
13
- password?: string | undefined;
14
- }, {
15
- host: string;
16
- database: string;
17
- port?: number | undefined;
18
- user?: string | undefined;
19
- password?: string | undefined;
20
- }>, import("zod").ZodObject<{
21
- url: import("zod").ZodString;
22
- }, "strip", import("zod").ZodTypeAny, {
23
- url: string;
24
- }, {
25
- url: string;
26
- }>]>;
27
- export type MysqlCredentials = TypeOf<typeof mysqlCredentials>;
28
- export declare const printCliConnectionIssues: (options: any) => void;
29
- export declare const printConfigConnectionIssues: (options: Record<string, unknown>) => void;
@@ -1,41 +0,0 @@
1
- export declare const withStyle: {
2
- error: (str: string) => string;
3
- warning: (str: string) => string;
4
- errorWarning: (str: string) => string;
5
- fullWarning: (str: string) => string;
6
- suggestion: (str: string) => string;
7
- info: (str: string) => string;
8
- };
9
- export declare const outputs: {
10
- studio: {
11
- drivers: (param: string) => string;
12
- noCredentials: () => string;
13
- noDriver: () => string;
14
- noDialect: () => string;
15
- };
16
- common: {
17
- ambiguousParams: (command: string) => string;
18
- schema: (command: string) => string;
19
- };
20
- postgres: {
21
- connection: {
22
- required: () => string;
23
- awsDataApi: () => void;
24
- };
25
- };
26
- mysql: {
27
- connection: {
28
- driver: () => string;
29
- required: () => string;
30
- };
31
- };
32
- sqlite: {
33
- connection: {
34
- driver: () => string;
35
- url: (driver: string) => string;
36
- authToken: (driver: string) => string;
37
- };
38
- introspect: {};
39
- push: {};
40
- };
41
- };
@@ -1,46 +0,0 @@
1
- import { TypeOf } from "zod";
2
- export declare const postgresCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
3
- host: import("zod").ZodString;
4
- port: import("zod").ZodOptional<import("zod").ZodNumber>;
5
- user: import("zod").ZodDefault<import("zod").ZodString>;
6
- password: import("zod").ZodOptional<import("zod").ZodString>;
7
- database: import("zod").ZodString;
8
- ssl: import("zod").ZodOptional<import("zod").ZodBoolean>;
9
- }, "strip", import("zod").ZodTypeAny, {
10
- host: string;
11
- user: string;
12
- database: string;
13
- port?: number | undefined;
14
- password?: string | undefined;
15
- ssl?: boolean | undefined;
16
- }, {
17
- host: string;
18
- database: string;
19
- port?: number | undefined;
20
- user?: string | undefined;
21
- password?: string | undefined;
22
- ssl?: boolean | undefined;
23
- }>, import("zod").ZodObject<{
24
- url: import("zod").ZodString;
25
- }, "strip", import("zod").ZodTypeAny, {
26
- url: string;
27
- }, {
28
- url: string;
29
- }>, import("zod").ZodObject<{
30
- driver: import("zod").ZodLiteral<"aws-data-api">;
31
- database: import("zod").ZodString;
32
- secretArn: import("zod").ZodString;
33
- resourceArn: import("zod").ZodString;
34
- }, "strip", import("zod").ZodTypeAny, {
35
- database: string;
36
- driver: "aws-data-api";
37
- secretArn: string;
38
- resourceArn: string;
39
- }, {
40
- database: string;
41
- driver: "aws-data-api";
42
- secretArn: string;
43
- resourceArn: string;
44
- }>]>;
45
- export type PostgresCredentials = TypeOf<typeof postgresCredentials>;
46
- export declare const printConfigConnectionIssues: (options: Record<string, unknown>) => void;
@@ -1,22 +0,0 @@
1
- import { TypeOf } from "zod";
2
- export declare const sqliteCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
3
- driver: import("zod").ZodLiteral<"turso">;
4
- url: import("zod").ZodString;
5
- authToken: import("zod").ZodString;
6
- }, "strip", import("zod").ZodTypeAny, {
7
- url: string;
8
- driver: "turso";
9
- authToken: string;
10
- }, {
11
- url: string;
12
- driver: "turso";
13
- authToken: string;
14
- }>, import("zod").ZodObject<{
15
- url: import("zod").ZodString;
16
- }, "strip", import("zod").ZodTypeAny, {
17
- url: string;
18
- }, {
19
- url: string;
20
- }>]>;
21
- export type SqliteCredentials = TypeOf<typeof sqliteCredentials>;
22
- export declare const printConfigConnectionIssues: (options: Record<string, unknown>) => void;
@@ -1,92 +0,0 @@
1
- import { TypeOf } from "zod";
2
- export declare const credentials: import("zod").ZodIntersection<import("zod").ZodUnion<[import("zod").ZodObject<{
3
- host: import("zod").ZodString;
4
- port: import("zod").ZodOptional<import("zod").ZodNumber>;
5
- user: import("zod").ZodDefault<import("zod").ZodString>;
6
- password: import("zod").ZodOptional<import("zod").ZodString>;
7
- database: import("zod").ZodString;
8
- ssl: import("zod").ZodOptional<import("zod").ZodBoolean>;
9
- }, "strip", import("zod").ZodTypeAny, {
10
- host: string;
11
- user: string;
12
- database: string;
13
- port?: number | undefined;
14
- password?: string | undefined;
15
- ssl?: boolean | undefined;
16
- }, {
17
- host: string;
18
- database: string;
19
- port?: number | undefined;
20
- user?: string | undefined;
21
- password?: string | undefined;
22
- ssl?: boolean | undefined;
23
- }>, import("zod").ZodObject<{
24
- url: import("zod").ZodString;
25
- }, "strip", import("zod").ZodTypeAny, {
26
- url: string;
27
- }, {
28
- url: string;
29
- }>, import("zod").ZodObject<{
30
- driver: import("zod").ZodLiteral<"aws-data-api">;
31
- database: import("zod").ZodString;
32
- secretArn: import("zod").ZodString;
33
- resourceArn: import("zod").ZodString;
34
- }, "strip", import("zod").ZodTypeAny, {
35
- database: string;
36
- driver: "aws-data-api";
37
- secretArn: string;
38
- resourceArn: string;
39
- }, {
40
- database: string;
41
- driver: "aws-data-api";
42
- secretArn: string;
43
- resourceArn: string;
44
- }>]>, import("zod").ZodUnion<[import("zod").ZodObject<{
45
- host: import("zod").ZodString;
46
- port: import("zod").ZodOptional<import("zod").ZodNumber>;
47
- user: import("zod").ZodDefault<import("zod").ZodString>;
48
- password: import("zod").ZodOptional<import("zod").ZodString>;
49
- database: import("zod").ZodString;
50
- }, "strip", import("zod").ZodTypeAny, {
51
- host: string;
52
- user: string;
53
- database: string;
54
- port?: number | undefined;
55
- password?: string | undefined;
56
- }, {
57
- host: string;
58
- database: string;
59
- port?: number | undefined;
60
- user?: string | undefined;
61
- password?: string | undefined;
62
- }>, import("zod").ZodObject<{
63
- url: import("zod").ZodString;
64
- }, "strip", import("zod").ZodTypeAny, {
65
- url: string;
66
- }, {
67
- url: string;
68
- }>]>>;
69
- export type Credentials = TypeOf<typeof credentials>;
70
- export declare const studioCliParams: import("zod").ZodObject<{
71
- port: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
72
- host: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
73
- config: import("zod").ZodOptional<import("zod").ZodString>;
74
- }, "strip", import("zod").ZodTypeAny, {
75
- host: string;
76
- port: number;
77
- config?: string | undefined;
78
- }, {
79
- host?: string | undefined;
80
- port?: number | undefined;
81
- config?: string | undefined;
82
- }>;
83
- export declare const studioConfig: import("zod").ZodObject<{
84
- dialect: import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>;
85
- schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
86
- }, "strip", import("zod").ZodTypeAny, {
87
- schema: string | string[];
88
- dialect: "postgresql" | "mysql" | "sqlite";
89
- }, {
90
- schema: string | string[];
91
- dialect: "postgresql" | "mysql" | "sqlite";
92
- }>;
package/cli/views.d.ts DELETED
@@ -1,70 +0,0 @@
1
- import { Prompt, TaskView } from "hanji";
2
- import type { CommonSchema } from "../schemaValidator";
3
- import type { Named, NamedWithSchema } from "./commands/migrate";
4
- export declare const warning: (msg: string) => void;
5
- export declare const err: (msg: string) => void;
6
- export declare const info: (msg: string, greyMsg?: string) => string;
7
- export declare const grey: (msg: string) => string;
8
- export declare const error: (error: string, greyMsg?: string) => string;
9
- export declare const schema: (schema: CommonSchema) => string;
10
- export interface RenamePropmtItem<T> {
11
- from: T;
12
- to: T;
13
- }
14
- export declare const isRenamePromptItem: <T extends Named>(item: RenamePropmtItem<T> | T) => item is RenamePropmtItem<T>;
15
- export declare class ResolveColumnSelect<T extends Named> extends Prompt<RenamePropmtItem<T> | T> {
16
- private readonly tableName;
17
- private readonly base;
18
- private readonly data;
19
- constructor(tableName: string, base: Named, data: (RenamePropmtItem<T> | T)[]);
20
- render(status: "idle" | "submitted" | "aborted"): string;
21
- result(): RenamePropmtItem<T> | T;
22
- }
23
- export declare const tableKey: (it: NamedWithSchema) => string;
24
- export declare class ResolveSelect<T extends NamedWithSchema> extends Prompt<RenamePropmtItem<T> | T> {
25
- private readonly base;
26
- private readonly entityType;
27
- private readonly state;
28
- constructor(base: T, data: (RenamePropmtItem<T> | T)[], entityType: "table" | "enum");
29
- render(status: "idle" | "submitted" | "aborted"): string;
30
- result(): RenamePropmtItem<T> | T;
31
- }
32
- export declare class ResolveSchemasSelect<T extends Named> extends Prompt<RenamePropmtItem<T> | T> {
33
- private readonly base;
34
- private readonly state;
35
- constructor(base: Named, data: (RenamePropmtItem<T> | T)[]);
36
- render(status: "idle" | "submitted" | "aborted"): string;
37
- result(): RenamePropmtItem<T> | T;
38
- }
39
- export type IntrospectStatus = "fetching" | "done";
40
- export type IntrospectStage = "tables" | "columns" | "enums" | "indexes" | "fks";
41
- export declare class IntrospectProgress extends TaskView {
42
- private readonly spinner;
43
- private timeout;
44
- private state;
45
- constructor();
46
- update(stage: IntrospectStage, count: number, status: IntrospectStatus): void;
47
- private formatCount;
48
- private statusText;
49
- render(): string;
50
- }
51
- export declare class MigrateProgress extends TaskView {
52
- private readonly spinner;
53
- private timeout;
54
- constructor();
55
- render(status: "pending" | "done"): string;
56
- }
57
- export declare class DropMigrationView<T extends {
58
- tag: string;
59
- }> extends Prompt<T> {
60
- private readonly data;
61
- constructor(data: T[]);
62
- render(status: "idle" | "submitted" | "aborted"): string;
63
- result(): T;
64
- }
65
- export declare const trimmedRange: <T>(arr: T[], index: number, limitLines: number) => {
66
- trimmed: T[];
67
- offset: number;
68
- startTrimmed: boolean;
69
- endTrimmed: boolean;
70
- };
package/global.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare const originUUID = "00000000-0000-0000-0000-000000000000";
2
- export declare const snapshotVersion = "6";
3
- export declare function assertUnreachable(x: never): never;
4
- export declare const mapValues: <IN, OUT>(obj: Record<string, IN>, map: (input: IN) => OUT) => Record<string, OUT>;
5
- export declare const mapKeys: <T>(obj: Record<string, T>, map: (key: string, value: T) => string) => Record<string, T>;
6
- export declare const mapEntries: <T>(obj: Record<string, T>, map: (key: string, value: T) => [string, T]) => Record<string, T>;
@@ -1,10 +0,0 @@
1
- import "./@types/utils";
2
- import type { Casing } from "./cli/validations/common";
3
- import type { SQLiteSchemaInternal } from "./serializer/sqliteSchema";
4
- export declare const indexName: (tableName: string, columns: string[]) => string;
5
- export declare const schemaToTypeScript: (schema: SQLiteSchemaInternal, casing: Casing) => {
6
- file: string;
7
- imports: string;
8
- decalrations: string;
9
- schemaEntry: string;
10
- };
package/jsonDiffer.d.ts DELETED
@@ -1,61 +0,0 @@
1
- export function diffForRenamedTables(pairs: any): any;
2
- export function diffForRenamedColumn(t1: any, t2: any): any;
3
- export function diffSchemasOrTables(left: any, right: any): {
4
- added: any[];
5
- deleted: any[];
6
- };
7
- export function diffColumns(left: any, right: any): {
8
- [k: string]: any;
9
- };
10
- export function applyJsonDiff(json1: any, json2: any): {
11
- alteredTablesWithColumns: {
12
- name: any;
13
- schema: any;
14
- altered: any[];
15
- addedIndexes: {
16
- [k: string]: any;
17
- };
18
- deletedIndexes: {
19
- [k: string]: any;
20
- };
21
- alteredIndexes: {
22
- [k: string]: any;
23
- };
24
- addedForeignKeys: {
25
- [k: string]: any;
26
- };
27
- deletedForeignKeys: {
28
- [k: string]: any;
29
- };
30
- alteredForeignKeys: {
31
- [k: string]: any;
32
- };
33
- addedCompositePKs: {
34
- [k: string]: any;
35
- };
36
- deletedCompositePKs: {
37
- [k: string]: any;
38
- };
39
- alteredCompositePKs: {
40
- [k: string]: any;
41
- };
42
- addedUniqueConstraints: {
43
- [k: string]: any;
44
- };
45
- deletedUniqueConstraints: {
46
- [k: string]: any;
47
- };
48
- alteredUniqueConstraints: {
49
- [k: string]: any;
50
- };
51
- }[];
52
- alteredEnums: {
53
- name: any;
54
- schema: any;
55
- addedValues: {
56
- before: any;
57
- value: any;
58
- }[];
59
- deletedValues: any[];
60
- }[];
61
- };