drizzle-kit 0.20.17-cab52ad → 0.20.17-d71f2ee
Sign up to get free protection for your applications and to get access to all the features.
- package/@types/utils.d.ts +13 -0
- package/bin.cjs +372 -7335
- package/cli/commands/migrate.d.ts +287 -0
- package/cli/commands/mysqlIntrospect.d.ts +50 -0
- package/cli/commands/mysqlPushUtils.d.ts +14 -0
- package/cli/commands/pgIntrospect.d.ts +59 -0
- package/cli/commands/pgPushUtils.d.ts +11 -0
- package/cli/commands/sqliteIntrospect.d.ts +103 -0
- package/cli/commands/sqlitePushUtils.d.ts +15 -0
- package/cli/commands/utils.d.ts +180 -0
- package/cli/connections.d.ts +18 -0
- package/cli/selector-ui.d.ts +13 -0
- package/cli/utils.d.ts +13 -0
- package/cli/validations/cli.d.ts +169 -0
- package/cli/validations/common.d.ts +214 -0
- package/cli/validations/mysql.d.ts +29 -0
- package/cli/validations/outputs.d.ts +41 -0
- package/cli/validations/pg.d.ts +46 -0
- package/cli/validations/sqlite.d.ts +22 -0
- package/cli/validations/studio.d.ts +92 -0
- package/cli/views.d.ts +70 -0
- package/global.d.ts +6 -0
- package/index.d.mts +6 -14
- package/index.d.ts +6 -14
- package/introspect-sqlite.d.ts +10 -0
- package/jsonDiffer.d.ts +61 -0
- package/jsonStatements.d.ts +376 -0
- package/migrationPreparator.d.ts +35 -0
- package/package.json +16 -5
- package/payload.d.mts +18 -987
- package/payload.d.ts +18 -987
- package/payload.js +16831 -19058
- package/payload.mjs +16827 -19079
- package/schemaValidator.d.ts +1316 -0
- package/serializer/index.d.ts +9 -0
- package/serializer/mysqlImports.d.ts +7 -0
- package/serializer/mysqlSchema.d.ts +4650 -0
- package/serializer/mysqlSerializer.d.ts +7 -0
- package/serializer/pgImports.d.ts +11 -0
- package/serializer/pgSchema.d.ts +4792 -0
- package/serializer/pgSerializer.d.ts +7 -0
- package/serializer/schemaToDrizzle.d.ts +7 -0
- package/serializer/sqliteImports.d.ts +7 -0
- package/serializer/sqliteSchema.d.ts +2801 -0
- package/serializer/sqliteSerializer.d.ts +6 -0
- package/serializer/studio.d.ts +53 -0
- package/snapshotsDiffer.d.ts +3936 -0
- package/sqlgenerator.d.ts +33 -0
- package/utils/words.d.ts +7 -0
- package/utils-studio.d.mts +4 -0
- package/utils-studio.d.ts +4 -0
- package/utils.d.ts +78 -0
@@ -0,0 +1,180 @@
|
|
1
|
+
import { MysqlCredentials } from "../validations/mysql";
|
2
|
+
import { PostgresCredentials } from "../validations/pg";
|
3
|
+
import { SqliteCredentials } from "../validations/sqlite";
|
4
|
+
import { Casing, CliConfig } from "../validations/common";
|
5
|
+
import { type Dialect } from "../../schemaValidator";
|
6
|
+
import { CliCheckConfig, CliConfigGenerate } from "../validations/cli";
|
7
|
+
export declare const safeRegister: () => Promise<{
|
8
|
+
unregister: () => void;
|
9
|
+
}>;
|
10
|
+
export type GenerateConfig = {
|
11
|
+
dialect: Dialect;
|
12
|
+
schema: string | string[];
|
13
|
+
out: string;
|
14
|
+
breakpoints: boolean;
|
15
|
+
name?: string;
|
16
|
+
custom: boolean;
|
17
|
+
bundle: boolean;
|
18
|
+
};
|
19
|
+
export declare const prepareGenerateConfig: (options: CliConfigGenerate) => Promise<GenerateConfig>;
|
20
|
+
export declare const flattenDatabaseCredentials: (config: any) => any;
|
21
|
+
export declare const preparePushConfig: (options: Record<string, unknown>) => Promise<({
|
22
|
+
dialect: "mysql";
|
23
|
+
credentials: MysqlCredentials;
|
24
|
+
} | {
|
25
|
+
dialect: "postgresql";
|
26
|
+
credentials: PostgresCredentials;
|
27
|
+
} | {
|
28
|
+
dialect: "sqlite";
|
29
|
+
credentials: SqliteCredentials;
|
30
|
+
}) & {
|
31
|
+
schemaPath: string | string[];
|
32
|
+
verbose: boolean;
|
33
|
+
strict: boolean;
|
34
|
+
tablesFilter: string[];
|
35
|
+
schemasFilter: string[];
|
36
|
+
}>;
|
37
|
+
export declare const preparePullConfig: (options: Record<string, unknown>) => Promise<({
|
38
|
+
dialect: "mysql";
|
39
|
+
credentials: MysqlCredentials;
|
40
|
+
} | {
|
41
|
+
dialect: "postgresql";
|
42
|
+
credentials: PostgresCredentials;
|
43
|
+
} | {
|
44
|
+
dialect: "sqlite";
|
45
|
+
credentials: SqliteCredentials;
|
46
|
+
}) & {
|
47
|
+
out: string;
|
48
|
+
breakpoints: boolean;
|
49
|
+
casing: Casing;
|
50
|
+
tablesFilter: string[];
|
51
|
+
schemasFilter: string[];
|
52
|
+
}>;
|
53
|
+
export declare const prepareStudioConfig: (options: Record<string, unknown>) => Promise<{
|
54
|
+
dialect: "postgresql";
|
55
|
+
schema: string | string[];
|
56
|
+
host: string;
|
57
|
+
port: number;
|
58
|
+
credentials: {
|
59
|
+
host: string;
|
60
|
+
user: string;
|
61
|
+
database: string;
|
62
|
+
port?: number | undefined;
|
63
|
+
password?: string | undefined;
|
64
|
+
ssl?: boolean | undefined;
|
65
|
+
} | {
|
66
|
+
url: string;
|
67
|
+
} | {
|
68
|
+
driver: "aws-data-api";
|
69
|
+
database: string;
|
70
|
+
secretArn: string;
|
71
|
+
resourceArn: string;
|
72
|
+
};
|
73
|
+
} | {
|
74
|
+
dialect: "mysql";
|
75
|
+
schema: string | string[];
|
76
|
+
host: string;
|
77
|
+
port: number;
|
78
|
+
credentials: {
|
79
|
+
host: string;
|
80
|
+
user: string;
|
81
|
+
database: string;
|
82
|
+
port?: number | undefined;
|
83
|
+
password?: string | undefined;
|
84
|
+
} | {
|
85
|
+
url: string;
|
86
|
+
};
|
87
|
+
} | {
|
88
|
+
dialect: "sqlite";
|
89
|
+
schema: string | string[];
|
90
|
+
host: string;
|
91
|
+
port: number;
|
92
|
+
credentials: {
|
93
|
+
url: string;
|
94
|
+
driver: "turso";
|
95
|
+
authToken: string;
|
96
|
+
} | {
|
97
|
+
url: string;
|
98
|
+
};
|
99
|
+
}>;
|
100
|
+
export declare const migrateConfig: import("zod").ZodObject<{
|
101
|
+
dialect: import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
102
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
103
|
+
migrations: import("zod").ZodOptional<import("zod").ZodObject<{
|
104
|
+
table: import("zod").ZodOptional<import("zod").ZodString>;
|
105
|
+
schema: import("zod").ZodOptional<import("zod").ZodString>;
|
106
|
+
}, "strip", import("zod").ZodTypeAny, {
|
107
|
+
schema?: string | undefined;
|
108
|
+
table?: string | undefined;
|
109
|
+
}, {
|
110
|
+
schema?: string | undefined;
|
111
|
+
table?: string | undefined;
|
112
|
+
}>>;
|
113
|
+
}, "strip", import("zod").ZodTypeAny, {
|
114
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
115
|
+
out: string;
|
116
|
+
migrations?: {
|
117
|
+
schema?: string | undefined;
|
118
|
+
table?: string | undefined;
|
119
|
+
} | undefined;
|
120
|
+
}, {
|
121
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
122
|
+
out?: string | undefined;
|
123
|
+
migrations?: {
|
124
|
+
schema?: string | undefined;
|
125
|
+
table?: string | undefined;
|
126
|
+
} | undefined;
|
127
|
+
}>;
|
128
|
+
export declare const prepareMigrateConfig: (options: Record<string, unknown>) => Promise<{
|
129
|
+
dialect: "postgresql";
|
130
|
+
out: string;
|
131
|
+
credentials: {
|
132
|
+
host: string;
|
133
|
+
user: string;
|
134
|
+
database: string;
|
135
|
+
port?: number | undefined;
|
136
|
+
password?: string | undefined;
|
137
|
+
ssl?: boolean | undefined;
|
138
|
+
} | {
|
139
|
+
url: string;
|
140
|
+
} | {
|
141
|
+
driver: "aws-data-api";
|
142
|
+
database: string;
|
143
|
+
secretArn: string;
|
144
|
+
resourceArn: string;
|
145
|
+
};
|
146
|
+
schema: string | undefined;
|
147
|
+
table: string | undefined;
|
148
|
+
} | {
|
149
|
+
dialect: "mysql";
|
150
|
+
out: string;
|
151
|
+
credentials: {
|
152
|
+
host: string;
|
153
|
+
user: string;
|
154
|
+
database: string;
|
155
|
+
port?: number | undefined;
|
156
|
+
password?: string | undefined;
|
157
|
+
} | {
|
158
|
+
url: string;
|
159
|
+
};
|
160
|
+
schema: string | undefined;
|
161
|
+
table: string | undefined;
|
162
|
+
} | {
|
163
|
+
dialect: "sqlite";
|
164
|
+
out: string;
|
165
|
+
credentials: {
|
166
|
+
url: string;
|
167
|
+
driver: "turso";
|
168
|
+
authToken: string;
|
169
|
+
} | {
|
170
|
+
url: string;
|
171
|
+
};
|
172
|
+
schema: string | undefined;
|
173
|
+
table: string | undefined;
|
174
|
+
}>;
|
175
|
+
export declare const assertOutFolder: (it: CliCheckConfig) => Promise<{
|
176
|
+
out: string;
|
177
|
+
dialect: Dialect;
|
178
|
+
}>;
|
179
|
+
export declare const drizzleConfigFromFile: (configPath?: string) => Promise<CliConfig>;
|
180
|
+
export declare const readDrizzleConfig: (configPath?: string) => Promise<any>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import type { DB, Proxy, SQLiteDB, SqliteProxy } from "../utils";
|
2
|
+
import type { PostgresCredentials } from "./validations/pg";
|
3
|
+
import type { MysqlCredentials } from "./validations/mysql";
|
4
|
+
import type { SqliteCredentials } from "./validations/sqlite";
|
5
|
+
import type { MigrationConfig } from "drizzle-orm/migrator";
|
6
|
+
export declare const preparePostgresDB: (credentials: PostgresCredentials) => Promise<DB & {
|
7
|
+
proxy: Proxy;
|
8
|
+
migrate: (config: string | MigrationConfig) => Promise<void>;
|
9
|
+
}>;
|
10
|
+
export declare const connectToMySQL: (it: MysqlCredentials) => Promise<{
|
11
|
+
db: DB;
|
12
|
+
proxy: Proxy;
|
13
|
+
database: string;
|
14
|
+
migrate: (config: MigrationConfig) => Promise<void>;
|
15
|
+
}>;
|
16
|
+
export declare const connectToSQLite: (credentials: SqliteCredentials) => Promise<SQLiteDB & SqliteProxy & {
|
17
|
+
migrate: (config: MigrationConfig) => Promise<void>;
|
18
|
+
}>;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Prompt } from "hanji";
|
2
|
+
export declare class Select extends Prompt<{
|
3
|
+
index: number;
|
4
|
+
value: string;
|
5
|
+
}> {
|
6
|
+
private readonly data;
|
7
|
+
constructor(items: string[]);
|
8
|
+
render(status: "idle" | "submitted" | "aborted"): string;
|
9
|
+
result(): {
|
10
|
+
index: number;
|
11
|
+
value: string;
|
12
|
+
};
|
13
|
+
}
|
package/cli/utils.d.ts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
export declare const assertExists: (it?: any) => void;
|
2
|
+
export declare const assertStudioNodeVersion: () => void;
|
3
|
+
export declare const checkPackage: (it: string) => Promise<boolean>;
|
4
|
+
export declare const assertPackages: (...pkgs: string[]) => Promise<void>;
|
5
|
+
export declare const assertEitherPackage: (...pkgs: string[]) => Promise<string[]>;
|
6
|
+
export declare const assertOrmCoreVersion: () => Promise<void>;
|
7
|
+
export declare const ormCoreVersions: () => Promise<{
|
8
|
+
compatibilityVersion: number;
|
9
|
+
npmVersion: string;
|
10
|
+
} | {
|
11
|
+
compatibilityVersion?: undefined;
|
12
|
+
npmVersion?: undefined;
|
13
|
+
}>;
|
@@ -0,0 +1,169 @@
|
|
1
|
+
import { TypeOf } from "zod";
|
2
|
+
export declare const cliConfigGenerate: import("zod").ZodObject<{
|
3
|
+
dialect: import("zod").ZodOptional<import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>>;
|
4
|
+
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
5
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
6
|
+
config: import("zod").ZodOptional<import("zod").ZodString>;
|
7
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
8
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
9
|
+
custom: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
10
|
+
}, "strict", import("zod").ZodTypeAny, {
|
11
|
+
custom: boolean;
|
12
|
+
out: string;
|
13
|
+
breakpoints: boolean;
|
14
|
+
name?: string | undefined;
|
15
|
+
schema?: string | string[] | undefined;
|
16
|
+
dialect?: "mysql" | "postgresql" | "sqlite" | undefined;
|
17
|
+
config?: string | undefined;
|
18
|
+
}, {
|
19
|
+
name?: string | undefined;
|
20
|
+
custom?: boolean | undefined;
|
21
|
+
schema?: string | string[] | undefined;
|
22
|
+
dialect?: "mysql" | "postgresql" | "sqlite" | undefined;
|
23
|
+
config?: string | undefined;
|
24
|
+
out?: string | undefined;
|
25
|
+
breakpoints?: boolean | undefined;
|
26
|
+
}>;
|
27
|
+
export type CliConfigGenerate = TypeOf<typeof cliConfigGenerate>;
|
28
|
+
export declare const pushParams: import("zod").ZodObject<{
|
29
|
+
dialect: import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
30
|
+
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
31
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
32
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>>;
|
33
|
+
driver: import("zod").ZodOptional<import("zod").ZodString>;
|
34
|
+
connectionString: import("zod").ZodOptional<import("zod").ZodString>;
|
35
|
+
uri: import("zod").ZodOptional<import("zod").ZodString>;
|
36
|
+
url: import("zod").ZodOptional<import("zod").ZodString>;
|
37
|
+
host: import("zod").ZodOptional<import("zod").ZodString>;
|
38
|
+
port: import("zod").ZodOptional<import("zod").ZodString>;
|
39
|
+
user: import("zod").ZodOptional<import("zod").ZodString>;
|
40
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
41
|
+
database: import("zod").ZodOptional<import("zod").ZodString>;
|
42
|
+
ssl: import("zod").ZodOptional<import("zod").ZodString>;
|
43
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
44
|
+
verbose: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
45
|
+
strict: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
46
|
+
}, "strip", import("zod").ZodTypeAny, {
|
47
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
48
|
+
schemaFilter: string | string[];
|
49
|
+
strict?: boolean | undefined;
|
50
|
+
schema?: string | string[] | undefined;
|
51
|
+
url?: string | undefined;
|
52
|
+
driver?: string | undefined;
|
53
|
+
tablesFilter?: string | string[] | undefined;
|
54
|
+
verbose?: boolean | undefined;
|
55
|
+
host?: string | undefined;
|
56
|
+
port?: string | undefined;
|
57
|
+
user?: string | undefined;
|
58
|
+
password?: string | undefined;
|
59
|
+
database?: string | undefined;
|
60
|
+
connectionString?: string | undefined;
|
61
|
+
uri?: string | undefined;
|
62
|
+
ssl?: string | undefined;
|
63
|
+
authToken?: string | undefined;
|
64
|
+
}, {
|
65
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
66
|
+
strict?: boolean | undefined;
|
67
|
+
schema?: string | string[] | undefined;
|
68
|
+
url?: string | undefined;
|
69
|
+
driver?: string | undefined;
|
70
|
+
tablesFilter?: string | string[] | undefined;
|
71
|
+
schemaFilter?: string | string[] | undefined;
|
72
|
+
verbose?: boolean | undefined;
|
73
|
+
host?: string | undefined;
|
74
|
+
port?: string | undefined;
|
75
|
+
user?: string | undefined;
|
76
|
+
password?: string | undefined;
|
77
|
+
database?: string | undefined;
|
78
|
+
connectionString?: string | undefined;
|
79
|
+
uri?: string | undefined;
|
80
|
+
ssl?: string | undefined;
|
81
|
+
authToken?: string | undefined;
|
82
|
+
}>;
|
83
|
+
export type PushParams = TypeOf<typeof pushParams>;
|
84
|
+
export declare const pullParams: import("zod").ZodObject<{
|
85
|
+
config: import("zod").ZodOptional<import("zod").ZodString>;
|
86
|
+
dialect: import("zod").ZodOptional<import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>>;
|
87
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
88
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
89
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>>;
|
90
|
+
driver: import("zod").ZodOptional<import("zod").ZodString>;
|
91
|
+
connectionString: import("zod").ZodOptional<import("zod").ZodString>;
|
92
|
+
uri: import("zod").ZodOptional<import("zod").ZodString>;
|
93
|
+
host: import("zod").ZodOptional<import("zod").ZodString>;
|
94
|
+
port: import("zod").ZodOptional<import("zod").ZodString>;
|
95
|
+
user: import("zod").ZodOptional<import("zod").ZodString>;
|
96
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
97
|
+
database: import("zod").ZodOptional<import("zod").ZodString>;
|
98
|
+
ssl: import("zod").ZodOptional<import("zod").ZodString>;
|
99
|
+
url: import("zod").ZodOptional<import("zod").ZodString>;
|
100
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
101
|
+
introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
102
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
103
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
104
|
+
config: import("zod").ZodOptional<import("zod").ZodString>;
|
105
|
+
dialect: import("zod").ZodOptional<import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>>;
|
106
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
107
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
108
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>>;
|
109
|
+
driver: import("zod").ZodOptional<import("zod").ZodString>;
|
110
|
+
connectionString: import("zod").ZodOptional<import("zod").ZodString>;
|
111
|
+
uri: import("zod").ZodOptional<import("zod").ZodString>;
|
112
|
+
host: import("zod").ZodOptional<import("zod").ZodString>;
|
113
|
+
port: import("zod").ZodOptional<import("zod").ZodString>;
|
114
|
+
user: import("zod").ZodOptional<import("zod").ZodString>;
|
115
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
116
|
+
database: import("zod").ZodOptional<import("zod").ZodString>;
|
117
|
+
ssl: import("zod").ZodOptional<import("zod").ZodString>;
|
118
|
+
url: import("zod").ZodOptional<import("zod").ZodString>;
|
119
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
120
|
+
introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
121
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
122
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
123
|
+
config: import("zod").ZodOptional<import("zod").ZodString>;
|
124
|
+
dialect: import("zod").ZodOptional<import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>>;
|
125
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
126
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
127
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>>;
|
128
|
+
driver: import("zod").ZodOptional<import("zod").ZodString>;
|
129
|
+
connectionString: import("zod").ZodOptional<import("zod").ZodString>;
|
130
|
+
uri: import("zod").ZodOptional<import("zod").ZodString>;
|
131
|
+
host: import("zod").ZodOptional<import("zod").ZodString>;
|
132
|
+
port: import("zod").ZodOptional<import("zod").ZodString>;
|
133
|
+
user: import("zod").ZodOptional<import("zod").ZodString>;
|
134
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
135
|
+
database: import("zod").ZodOptional<import("zod").ZodString>;
|
136
|
+
ssl: import("zod").ZodOptional<import("zod").ZodString>;
|
137
|
+
url: import("zod").ZodOptional<import("zod").ZodString>;
|
138
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
139
|
+
introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
140
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
141
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
142
|
+
export type PullParams = TypeOf<typeof pullParams>;
|
143
|
+
export declare const configCheck: import("zod").ZodObject<{
|
144
|
+
dialect: import("zod").ZodOptional<import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>>;
|
145
|
+
out: import("zod").ZodOptional<import("zod").ZodString>;
|
146
|
+
}, "strip", import("zod").ZodTypeAny, {
|
147
|
+
dialect?: "mysql" | "postgresql" | "sqlite" | undefined;
|
148
|
+
out?: string | undefined;
|
149
|
+
}, {
|
150
|
+
dialect?: "mysql" | "postgresql" | "sqlite" | undefined;
|
151
|
+
out?: string | undefined;
|
152
|
+
}>;
|
153
|
+
export declare const cliConfigCheck: import("zod").ZodIntersection<import("zod").ZodObject<{
|
154
|
+
config: import("zod").ZodOptional<import("zod").ZodString>;
|
155
|
+
}, "strip", import("zod").ZodTypeAny, {
|
156
|
+
config?: string | undefined;
|
157
|
+
}, {
|
158
|
+
config?: string | undefined;
|
159
|
+
}>, import("zod").ZodObject<{
|
160
|
+
dialect: import("zod").ZodOptional<import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>>;
|
161
|
+
out: import("zod").ZodOptional<import("zod").ZodString>;
|
162
|
+
}, "strip", import("zod").ZodTypeAny, {
|
163
|
+
dialect?: "mysql" | "postgresql" | "sqlite" | undefined;
|
164
|
+
out?: string | undefined;
|
165
|
+
}, {
|
166
|
+
dialect?: "mysql" | "postgresql" | "sqlite" | undefined;
|
167
|
+
out?: string | undefined;
|
168
|
+
}>>;
|
169
|
+
export type CliCheckConfig = TypeOf<typeof cliConfigCheck>;
|
@@ -0,0 +1,214 @@
|
|
1
|
+
import { TypeOf } from "zod";
|
2
|
+
export type Commands = "introspect" | "generate" | "check" | "up" | "drop" | "push";
|
3
|
+
/**
|
4
|
+
* This function checks an input from a user and if there are any params together with config path - return true
|
5
|
+
* @param options - user input
|
6
|
+
* @param inputWhitelist - whitelist some cli options that can be used together with config option
|
7
|
+
* @returns true if there was a collision, false if everything is valid
|
8
|
+
*/
|
9
|
+
export declare const assertCollisions: (options: Record<string, unknown>, command: Commands, inputWhitelist?: string[]) => "config" | "cli";
|
10
|
+
export declare const sqliteDriver: import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">]>;
|
11
|
+
export declare const postgresDriver: import("zod").ZodLiteral<"aws-data-api">;
|
12
|
+
export declare const mysqlDriver: import("zod").ZodLiteral<"mysql2">;
|
13
|
+
export declare const driver: import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">]>, import("zod").ZodLiteral<"aws-data-api">, import("zod").ZodLiteral<"mysql2">]>;
|
14
|
+
export declare const configCommonSchema: import("zod").ZodObject<{
|
15
|
+
dialect: import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
16
|
+
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
17
|
+
out: import("zod").ZodOptional<import("zod").ZodString>;
|
18
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
19
|
+
driver: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">]>, import("zod").ZodLiteral<"aws-data-api">, import("zod").ZodLiteral<"mysql2">]>>;
|
20
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
21
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
22
|
+
}, "strip", import("zod").ZodTypeAny, {
|
23
|
+
schema: string | string[];
|
24
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
25
|
+
breakpoints: boolean;
|
26
|
+
schemaFilter: string | string[];
|
27
|
+
out?: string | undefined;
|
28
|
+
driver?: "better-sqlite" | "turso" | "libsql" | "d1" | "expo" | "aws-data-api" | "mysql2" | undefined;
|
29
|
+
tablesFilter?: string | string[] | undefined;
|
30
|
+
}, {
|
31
|
+
schema: string | string[];
|
32
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
33
|
+
out?: string | undefined;
|
34
|
+
breakpoints?: boolean | undefined;
|
35
|
+
driver?: "better-sqlite" | "turso" | "libsql" | "d1" | "expo" | "aws-data-api" | "mysql2" | undefined;
|
36
|
+
tablesFilter?: string | string[] | undefined;
|
37
|
+
schemaFilter?: string | string[] | undefined;
|
38
|
+
}>;
|
39
|
+
export declare const casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
40
|
+
export declare const introspectParams: import("zod").ZodObject<{
|
41
|
+
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
42
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
43
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
44
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
45
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
46
|
+
introspect: import("zod").ZodDefault<import("zod").ZodObject<{
|
47
|
+
casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
48
|
+
}, "strip", import("zod").ZodTypeAny, {
|
49
|
+
casing: "camel" | "preserve";
|
50
|
+
}, {
|
51
|
+
casing?: "camel" | "preserve" | undefined;
|
52
|
+
}>>;
|
53
|
+
}, "strip", import("zod").ZodTypeAny, {
|
54
|
+
introspect: {
|
55
|
+
casing: "camel" | "preserve";
|
56
|
+
};
|
57
|
+
out: string;
|
58
|
+
breakpoints: boolean;
|
59
|
+
schemaFilter: string | string[];
|
60
|
+
schema?: string | string[] | undefined;
|
61
|
+
tablesFilter?: string | string[] | undefined;
|
62
|
+
}, {
|
63
|
+
schema?: string | string[] | undefined;
|
64
|
+
introspect?: {
|
65
|
+
casing?: "camel" | "preserve" | undefined;
|
66
|
+
} | undefined;
|
67
|
+
out?: string | undefined;
|
68
|
+
breakpoints?: boolean | undefined;
|
69
|
+
tablesFilter?: string | string[] | undefined;
|
70
|
+
schemaFilter?: string | string[] | undefined;
|
71
|
+
}>;
|
72
|
+
export type IntrospectParams = TypeOf<typeof introspectParams>;
|
73
|
+
export type Casing = TypeOf<typeof casing>;
|
74
|
+
export declare const configIntrospectCliSchema: import("zod").ZodObject<{
|
75
|
+
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
76
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
77
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
78
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
79
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
80
|
+
introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
81
|
+
}, "strip", import("zod").ZodTypeAny, {
|
82
|
+
out: string;
|
83
|
+
breakpoints: boolean;
|
84
|
+
schemaFilter: string | string[];
|
85
|
+
introspectCasing: "camel" | "preserve";
|
86
|
+
schema?: string | string[] | undefined;
|
87
|
+
tablesFilter?: string | string[] | undefined;
|
88
|
+
}, {
|
89
|
+
schema?: string | string[] | undefined;
|
90
|
+
out?: string | undefined;
|
91
|
+
breakpoints?: boolean | undefined;
|
92
|
+
tablesFilter?: string | string[] | undefined;
|
93
|
+
schemaFilter?: string | string[] | undefined;
|
94
|
+
introspectCasing?: "camel" | "preserve" | undefined;
|
95
|
+
}>;
|
96
|
+
export declare const configGenerateSchema: import("zod").ZodObject<{
|
97
|
+
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
98
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
99
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
100
|
+
}, "strip", import("zod").ZodTypeAny, {
|
101
|
+
schema: string | string[];
|
102
|
+
out: string;
|
103
|
+
breakpoints: boolean;
|
104
|
+
}, {
|
105
|
+
schema: string | string[];
|
106
|
+
out?: string | undefined;
|
107
|
+
breakpoints?: boolean | undefined;
|
108
|
+
}>;
|
109
|
+
export type GenerateSchema = TypeOf<typeof configGenerateSchema>;
|
110
|
+
export declare const configPushSchema: import("zod").ZodObject<{
|
111
|
+
dialect: import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
112
|
+
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
113
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
114
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
115
|
+
verbose: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
116
|
+
strict: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
117
|
+
out: import("zod").ZodOptional<import("zod").ZodString>;
|
118
|
+
}, "strip", import("zod").ZodTypeAny, {
|
119
|
+
strict: boolean;
|
120
|
+
schema: string | string[];
|
121
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
122
|
+
schemaFilter: string | string[];
|
123
|
+
verbose: boolean;
|
124
|
+
out?: string | undefined;
|
125
|
+
tablesFilter?: string | string[] | undefined;
|
126
|
+
}, {
|
127
|
+
schema: string | string[];
|
128
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
129
|
+
strict?: boolean | undefined;
|
130
|
+
out?: string | undefined;
|
131
|
+
tablesFilter?: string | string[] | undefined;
|
132
|
+
schemaFilter?: string | string[] | undefined;
|
133
|
+
verbose?: boolean | undefined;
|
134
|
+
}>;
|
135
|
+
export declare const mysqlConnectionSchema: import("zod").ZodUnion<[import("zod").ZodObject<{
|
136
|
+
host: import("zod").ZodString;
|
137
|
+
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
138
|
+
user: import("zod").ZodDefault<import("zod").ZodString>;
|
139
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
140
|
+
database: import("zod").ZodString;
|
141
|
+
}, "strip", import("zod").ZodTypeAny, {
|
142
|
+
host: string;
|
143
|
+
user: string;
|
144
|
+
database: string;
|
145
|
+
port?: number | undefined;
|
146
|
+
password?: string | undefined;
|
147
|
+
}, {
|
148
|
+
host: string;
|
149
|
+
database: string;
|
150
|
+
port?: number | undefined;
|
151
|
+
user?: string | undefined;
|
152
|
+
password?: string | undefined;
|
153
|
+
}>, import("zod").ZodObject<{
|
154
|
+
connectionString: import("zod").ZodString;
|
155
|
+
}, "strip", import("zod").ZodTypeAny, {
|
156
|
+
connectionString: string;
|
157
|
+
}, {
|
158
|
+
connectionString: string;
|
159
|
+
}>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>;
|
160
|
+
export declare const mySqlCliConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
|
161
|
+
dialect: import("zod").ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
162
|
+
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
163
|
+
out: import("zod").ZodOptional<import("zod").ZodString>;
|
164
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
165
|
+
driver: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">]>, import("zod").ZodLiteral<"aws-data-api">, import("zod").ZodLiteral<"mysql2">]>>;
|
166
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
167
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
168
|
+
}, "strip", import("zod").ZodTypeAny, {
|
169
|
+
schema: string | string[];
|
170
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
171
|
+
breakpoints: boolean;
|
172
|
+
schemaFilter: string | string[];
|
173
|
+
out?: string | undefined;
|
174
|
+
driver?: "better-sqlite" | "turso" | "libsql" | "d1" | "expo" | "aws-data-api" | "mysql2" | undefined;
|
175
|
+
tablesFilter?: string | string[] | undefined;
|
176
|
+
}, {
|
177
|
+
schema: string | string[];
|
178
|
+
dialect: "mysql" | "postgresql" | "sqlite";
|
179
|
+
out?: string | undefined;
|
180
|
+
breakpoints?: boolean | undefined;
|
181
|
+
driver?: "better-sqlite" | "turso" | "libsql" | "d1" | "expo" | "aws-data-api" | "mysql2" | undefined;
|
182
|
+
tablesFilter?: string | string[] | undefined;
|
183
|
+
schemaFilter?: string | string[] | undefined;
|
184
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
185
|
+
host: import("zod").ZodString;
|
186
|
+
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
187
|
+
user: import("zod").ZodDefault<import("zod").ZodString>;
|
188
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
189
|
+
database: import("zod").ZodString;
|
190
|
+
}, "strip", import("zod").ZodTypeAny, {
|
191
|
+
host: string;
|
192
|
+
user: string;
|
193
|
+
database: string;
|
194
|
+
port?: number | undefined;
|
195
|
+
password?: string | undefined;
|
196
|
+
}, {
|
197
|
+
host: string;
|
198
|
+
database: string;
|
199
|
+
port?: number | undefined;
|
200
|
+
user?: string | undefined;
|
201
|
+
password?: string | undefined;
|
202
|
+
}>, import("zod").ZodObject<{
|
203
|
+
connectionString: import("zod").ZodString;
|
204
|
+
}, "strip", import("zod").ZodTypeAny, {
|
205
|
+
connectionString: string;
|
206
|
+
}, {
|
207
|
+
connectionString: string;
|
208
|
+
}>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>>;
|
209
|
+
export type MySqlCliConfig = TypeOf<typeof mySqlCliConfigSchema>;
|
210
|
+
export type CliConfig = MySqlCliConfig;
|
211
|
+
export type SqliteDriver = TypeOf<typeof sqliteDriver>;
|
212
|
+
export type MysqlDriver = TypeOf<typeof mysqlDriver>;
|
213
|
+
export type PostgresDriver = TypeOf<typeof postgresDriver>;
|
214
|
+
export type Driver = TypeOf<typeof driver>;
|
@@ -0,0 +1,29 @@
|
|
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;
|