drizzle-kit 0.20.17-a1c0ab3 → 0.20.17-ab24478
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +17 -58
- package/package.json +1 -1
- package/payload.js +3 -48
- package/payload.mjs +3 -50
package/bin.cjs
CHANGED
@@ -7103,7 +7103,7 @@ var require_coerce = __commonJS({
|
|
7103
7103
|
var SemVer = require_semver();
|
7104
7104
|
var parse6 = require_parse();
|
7105
7105
|
var { safeRe: re2, t } = require_re();
|
7106
|
-
var
|
7106
|
+
var coerce3 = (version2, options) => {
|
7107
7107
|
if (version2 instanceof SemVer) {
|
7108
7108
|
return version2;
|
7109
7109
|
}
|
@@ -7138,7 +7138,7 @@ var require_coerce = __commonJS({
|
|
7138
7138
|
const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
7139
7139
|
return parse6(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
7140
7140
|
};
|
7141
|
-
module2.exports =
|
7141
|
+
module2.exports = coerce3;
|
7142
7142
|
}
|
7143
7143
|
});
|
7144
7144
|
|
@@ -8755,7 +8755,7 @@ var require_semver2 = __commonJS({
|
|
8755
8755
|
var gte = require_gte();
|
8756
8756
|
var lte = require_lte();
|
8757
8757
|
var cmp = require_cmp();
|
8758
|
-
var
|
8758
|
+
var coerce3 = require_coerce();
|
8759
8759
|
var Comparator = require_comparator();
|
8760
8760
|
var Range = require_range();
|
8761
8761
|
var satisfies = require_satisfies();
|
@@ -8793,7 +8793,7 @@ var require_semver2 = __commonJS({
|
|
8793
8793
|
gte,
|
8794
8794
|
lte,
|
8795
8795
|
cmp,
|
8796
|
-
coerce:
|
8796
|
+
coerce: coerce3,
|
8797
8797
|
Comparator,
|
8798
8798
|
Range,
|
8799
8799
|
satisfies,
|
@@ -9231,7 +9231,7 @@ var init_schemaValidator = __esm({
|
|
9231
9231
|
});
|
9232
9232
|
|
9233
9233
|
// src/cli/validations/common.ts
|
9234
|
-
var assertCollisions, sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema
|
9234
|
+
var assertCollisions, sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
|
9235
9235
|
var init_common = __esm({
|
9236
9236
|
"src/cli/validations/common.ts"() {
|
9237
9237
|
"use strict";
|
@@ -9270,9 +9270,9 @@ var init_common = __esm({
|
|
9270
9270
|
driver = unionType([sqliteDriver, postgresDriver, mysqlDriver]);
|
9271
9271
|
configCommonSchema = objectType({
|
9272
9272
|
dialect: dialect3,
|
9273
|
-
schema: unionType([stringType(), stringType().array()]),
|
9273
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
9274
9274
|
out: stringType().optional(),
|
9275
|
-
breakpoints: booleanType().default(true),
|
9275
|
+
breakpoints: booleanType().optional().default(true),
|
9276
9276
|
driver: driver.optional(),
|
9277
9277
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
9278
9278
|
schemaFilter: unionType([stringType(), stringType().array()]).default(["public"])
|
@@ -9314,24 +9314,6 @@ var init_common = __esm({
|
|
9314
9314
|
strict: booleanType().default(false),
|
9315
9315
|
out: stringType().optional()
|
9316
9316
|
});
|
9317
|
-
mysqlConnectionSchema = unionType([
|
9318
|
-
objectType({
|
9319
|
-
host: stringType(),
|
9320
|
-
port: coerce.number().optional(),
|
9321
|
-
user: stringType().default("mysql"),
|
9322
|
-
password: stringType().optional(),
|
9323
|
-
database: stringType()
|
9324
|
-
// ssl: boolean().optional(),
|
9325
|
-
}),
|
9326
|
-
objectType({
|
9327
|
-
connectionString: stringType()
|
9328
|
-
}),
|
9329
|
-
objectType({})
|
9330
|
-
]);
|
9331
|
-
mySqlCliConfigSchema = intersectionType(
|
9332
|
-
configCommonSchema,
|
9333
|
-
mysqlConnectionSchema
|
9334
|
-
);
|
9335
9317
|
}
|
9336
9318
|
});
|
9337
9319
|
|
@@ -9357,20 +9339,6 @@ var init_cli = __esm({
|
|
9357
9339
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
9358
9340
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
9359
9341
|
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
9360
|
-
driver: stringType().optional(),
|
9361
|
-
// pg
|
9362
|
-
connectionString: stringType().optional(),
|
9363
|
-
// mysql
|
9364
|
-
uri: stringType().optional(),
|
9365
|
-
// turso / libsql / sqlite
|
9366
|
-
url: stringType().optional(),
|
9367
|
-
host: stringType().optional(),
|
9368
|
-
port: stringType().optional(),
|
9369
|
-
user: stringType().optional(),
|
9370
|
-
password: stringType().optional(),
|
9371
|
-
database: stringType().optional(),
|
9372
|
-
ssl: stringType().optional(),
|
9373
|
-
authToken: stringType().optional(),
|
9374
9342
|
verbose: booleanType().optional(),
|
9375
9343
|
strict: booleanType().optional()
|
9376
9344
|
}).passthrough();
|
@@ -9380,19 +9348,6 @@ var init_cli = __esm({
|
|
9380
9348
|
out: stringType().optional().default("drizzle"),
|
9381
9349
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
9382
9350
|
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
9383
|
-
driver: stringType().optional(),
|
9384
|
-
// mysql / pg
|
9385
|
-
connectionString: stringType().optional(),
|
9386
|
-
// turso / libsql / sqlite
|
9387
|
-
uri: stringType().optional(),
|
9388
|
-
host: stringType().optional(),
|
9389
|
-
port: stringType().optional(),
|
9390
|
-
user: stringType().optional(),
|
9391
|
-
password: stringType().optional(),
|
9392
|
-
database: stringType().optional(),
|
9393
|
-
ssl: stringType().optional(),
|
9394
|
-
url: stringType().optional(),
|
9395
|
-
authToken: stringType().optional(),
|
9396
9351
|
introspectCasing: casing,
|
9397
9352
|
breakpoints: booleanType().optional().default(true)
|
9398
9353
|
}).passthrough();
|
@@ -9572,7 +9527,7 @@ var require_common = __commonJS({
|
|
9572
9527
|
function setup(env3) {
|
9573
9528
|
createDebug.debug = createDebug;
|
9574
9529
|
createDebug.default = createDebug;
|
9575
|
-
createDebug.coerce =
|
9530
|
+
createDebug.coerce = coerce3;
|
9576
9531
|
createDebug.disable = disable;
|
9577
9532
|
createDebug.enable = enable;
|
9578
9533
|
createDebug.enabled = enabled;
|
@@ -9713,7 +9668,7 @@ var require_common = __commonJS({
|
|
9713
9668
|
function toNamespace(regexp) {
|
9714
9669
|
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
9715
9670
|
}
|
9716
|
-
function
|
9671
|
+
function coerce3(val2) {
|
9717
9672
|
if (val2 instanceof Error) {
|
9718
9673
|
return val2.stack || val2.message;
|
9719
9674
|
}
|
@@ -15121,6 +15076,10 @@ var init_utils4 = __esm({
|
|
15121
15076
|
const { schema: schema5, out, config, breakpoints, custom: custom2, name, dialect: dialect7 } = options;
|
15122
15077
|
if (!(schema5 && out)) {
|
15123
15078
|
const drizzleConfig = await drizzleConfigFromFile(config);
|
15079
|
+
if (!drizzleConfig.schema) {
|
15080
|
+
console.error(`You have to provide 'schema' param`);
|
15081
|
+
process.exit(1);
|
15082
|
+
}
|
15124
15083
|
return {
|
15125
15084
|
dialect: drizzleConfig.dialect,
|
15126
15085
|
name,
|
@@ -15500,7 +15459,7 @@ var init_utils4 = __esm({
|
|
15500
15459
|
const required = require(`${path5}`);
|
15501
15460
|
const content = required.default ?? required;
|
15502
15461
|
unregister();
|
15503
|
-
const res =
|
15462
|
+
const res = configCommonSchema.safeParse(content);
|
15504
15463
|
if (!res.success) {
|
15505
15464
|
console.error(res.error);
|
15506
15465
|
console.log("Missing required params");
|
@@ -25135,14 +25094,14 @@ var require_to_regex_range = __commonJS({
|
|
25135
25094
|
}
|
25136
25095
|
return tokens;
|
25137
25096
|
}
|
25138
|
-
function filterPatterns(arr, comparison, prefix,
|
25097
|
+
function filterPatterns(arr, comparison, prefix, intersection2, options) {
|
25139
25098
|
let result = [];
|
25140
25099
|
for (let ele of arr) {
|
25141
25100
|
let { string } = ele;
|
25142
|
-
if (!
|
25101
|
+
if (!intersection2 && !contains(comparison, "string", string)) {
|
25143
25102
|
result.push(prefix + string);
|
25144
25103
|
}
|
25145
|
-
if (
|
25104
|
+
if (intersection2 && contains(comparison, "string", string)) {
|
25146
25105
|
result.push(prefix + string);
|
25147
25106
|
}
|
25148
25107
|
}
|
package/package.json
CHANGED
package/payload.js
CHANGED
@@ -7964,7 +7964,7 @@ var init_schemaValidator = __esm({
|
|
7964
7964
|
});
|
7965
7965
|
|
7966
7966
|
// src/cli/validations/common.ts
|
7967
|
-
var import_zod8, sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema
|
7967
|
+
var import_zod8, sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
|
7968
7968
|
var init_common2 = __esm({
|
7969
7969
|
"src/cli/validations/common.ts"() {
|
7970
7970
|
"use strict";
|
@@ -7983,9 +7983,9 @@ var init_common2 = __esm({
|
|
7983
7983
|
driver = (0, import_zod8.union)([sqliteDriver, postgresDriver, mysqlDriver]);
|
7984
7984
|
configCommonSchema = (0, import_zod8.object)({
|
7985
7985
|
dialect: dialect3,
|
7986
|
-
schema: (0, import_zod8.union)([(0, import_zod8.string)(), (0, import_zod8.string)().array()]),
|
7986
|
+
schema: (0, import_zod8.union)([(0, import_zod8.string)(), (0, import_zod8.string)().array()]).optional(),
|
7987
7987
|
out: (0, import_zod8.string)().optional(),
|
7988
|
-
breakpoints: (0, import_zod8.boolean)().default(true),
|
7988
|
+
breakpoints: (0, import_zod8.boolean)().optional().default(true),
|
7989
7989
|
driver: driver.optional(),
|
7990
7990
|
tablesFilter: (0, import_zod8.union)([(0, import_zod8.string)(), (0, import_zod8.string)().array()]).optional(),
|
7991
7991
|
schemaFilter: (0, import_zod8.union)([(0, import_zod8.string)(), (0, import_zod8.string)().array()]).default(["public"])
|
@@ -8027,24 +8027,6 @@ var init_common2 = __esm({
|
|
8027
8027
|
strict: (0, import_zod8.boolean)().default(false),
|
8028
8028
|
out: (0, import_zod8.string)().optional()
|
8029
8029
|
});
|
8030
|
-
mysqlConnectionSchema = (0, import_zod8.union)([
|
8031
|
-
(0, import_zod8.object)({
|
8032
|
-
host: (0, import_zod8.string)(),
|
8033
|
-
port: import_zod8.coerce.number().optional(),
|
8034
|
-
user: (0, import_zod8.string)().default("mysql"),
|
8035
|
-
password: (0, import_zod8.string)().optional(),
|
8036
|
-
database: (0, import_zod8.string)()
|
8037
|
-
// ssl: boolean().optional(),
|
8038
|
-
}),
|
8039
|
-
(0, import_zod8.object)({
|
8040
|
-
connectionString: (0, import_zod8.string)()
|
8041
|
-
}),
|
8042
|
-
(0, import_zod8.object)({})
|
8043
|
-
]);
|
8044
|
-
mySqlCliConfigSchema = (0, import_zod8.intersection)(
|
8045
|
-
configCommonSchema,
|
8046
|
-
mysqlConnectionSchema
|
8047
|
-
);
|
8048
8030
|
}
|
8049
8031
|
});
|
8050
8032
|
|
@@ -8070,20 +8052,6 @@ var init_cli = __esm({
|
|
8070
8052
|
schema: (0, import_zod9.union)([(0, import_zod9.string)(), (0, import_zod9.string)().array()]).optional(),
|
8071
8053
|
tablesFilter: (0, import_zod9.union)([(0, import_zod9.string)(), (0, import_zod9.string)().array()]).optional(),
|
8072
8054
|
schemaFilter: (0, import_zod9.union)([(0, import_zod9.string)(), (0, import_zod9.string)().array()]).optional().default(["public"]),
|
8073
|
-
driver: (0, import_zod9.string)().optional(),
|
8074
|
-
// pg
|
8075
|
-
connectionString: (0, import_zod9.string)().optional(),
|
8076
|
-
// mysql
|
8077
|
-
uri: (0, import_zod9.string)().optional(),
|
8078
|
-
// turso / libsql / sqlite
|
8079
|
-
url: (0, import_zod9.string)().optional(),
|
8080
|
-
host: (0, import_zod9.string)().optional(),
|
8081
|
-
port: (0, import_zod9.string)().optional(),
|
8082
|
-
user: (0, import_zod9.string)().optional(),
|
8083
|
-
password: (0, import_zod9.string)().optional(),
|
8084
|
-
database: (0, import_zod9.string)().optional(),
|
8085
|
-
ssl: (0, import_zod9.string)().optional(),
|
8086
|
-
authToken: (0, import_zod9.string)().optional(),
|
8087
8055
|
verbose: (0, import_zod9.boolean)().optional(),
|
8088
8056
|
strict: (0, import_zod9.boolean)().optional()
|
8089
8057
|
}).passthrough();
|
@@ -8093,19 +8061,6 @@ var init_cli = __esm({
|
|
8093
8061
|
out: (0, import_zod9.string)().optional().default("drizzle"),
|
8094
8062
|
tablesFilter: (0, import_zod9.union)([(0, import_zod9.string)(), (0, import_zod9.string)().array()]).optional(),
|
8095
8063
|
schemaFilter: (0, import_zod9.union)([(0, import_zod9.string)(), (0, import_zod9.string)().array()]).optional().default(["public"]),
|
8096
|
-
driver: (0, import_zod9.string)().optional(),
|
8097
|
-
// mysql / pg
|
8098
|
-
connectionString: (0, import_zod9.string)().optional(),
|
8099
|
-
// turso / libsql / sqlite
|
8100
|
-
uri: (0, import_zod9.string)().optional(),
|
8101
|
-
host: (0, import_zod9.string)().optional(),
|
8102
|
-
port: (0, import_zod9.string)().optional(),
|
8103
|
-
user: (0, import_zod9.string)().optional(),
|
8104
|
-
password: (0, import_zod9.string)().optional(),
|
8105
|
-
database: (0, import_zod9.string)().optional(),
|
8106
|
-
ssl: (0, import_zod9.string)().optional(),
|
8107
|
-
url: (0, import_zod9.string)().optional(),
|
8108
|
-
authToken: (0, import_zod9.string)().optional(),
|
8109
8064
|
introspectCasing: casing,
|
8110
8065
|
breakpoints: (0, import_zod9.boolean)().optional().default(true)
|
8111
8066
|
}).passthrough();
|
package/payload.mjs
CHANGED
@@ -7989,15 +7989,13 @@ var init_schemaValidator = __esm({
|
|
7989
7989
|
|
7990
7990
|
// src/cli/validations/common.ts
|
7991
7991
|
import {
|
7992
|
-
coerce as coerce3,
|
7993
7992
|
object as object7,
|
7994
7993
|
string as string7,
|
7995
7994
|
union as union9,
|
7996
|
-
intersection,
|
7997
7995
|
boolean as boolean5,
|
7998
7996
|
literal as literal6
|
7999
7997
|
} from "zod";
|
8000
|
-
var sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema
|
7998
|
+
var sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
|
8001
7999
|
var init_common2 = __esm({
|
8002
8000
|
"src/cli/validations/common.ts"() {
|
8003
8001
|
"use strict";
|
@@ -8015,9 +8013,9 @@ var init_common2 = __esm({
|
|
8015
8013
|
driver = union9([sqliteDriver, postgresDriver, mysqlDriver]);
|
8016
8014
|
configCommonSchema = object7({
|
8017
8015
|
dialect: dialect3,
|
8018
|
-
schema: union9([string7(), string7().array()]),
|
8016
|
+
schema: union9([string7(), string7().array()]).optional(),
|
8019
8017
|
out: string7().optional(),
|
8020
|
-
breakpoints: boolean5().default(true),
|
8018
|
+
breakpoints: boolean5().optional().default(true),
|
8021
8019
|
driver: driver.optional(),
|
8022
8020
|
tablesFilter: union9([string7(), string7().array()]).optional(),
|
8023
8021
|
schemaFilter: union9([string7(), string7().array()]).default(["public"])
|
@@ -8059,24 +8057,6 @@ var init_common2 = __esm({
|
|
8059
8057
|
strict: boolean5().default(false),
|
8060
8058
|
out: string7().optional()
|
8061
8059
|
});
|
8062
|
-
mysqlConnectionSchema = union9([
|
8063
|
-
object7({
|
8064
|
-
host: string7(),
|
8065
|
-
port: coerce3.number().optional(),
|
8066
|
-
user: string7().default("mysql"),
|
8067
|
-
password: string7().optional(),
|
8068
|
-
database: string7()
|
8069
|
-
// ssl: boolean().optional(),
|
8070
|
-
}),
|
8071
|
-
object7({
|
8072
|
-
connectionString: string7()
|
8073
|
-
}),
|
8074
|
-
object7({})
|
8075
|
-
]);
|
8076
|
-
mySqlCliConfigSchema = intersection(
|
8077
|
-
configCommonSchema,
|
8078
|
-
mysqlConnectionSchema
|
8079
|
-
);
|
8080
8060
|
}
|
8081
8061
|
});
|
8082
8062
|
|
@@ -8102,20 +8082,6 @@ var init_cli = __esm({
|
|
8102
8082
|
schema: union10([string8(), string8().array()]).optional(),
|
8103
8083
|
tablesFilter: union10([string8(), string8().array()]).optional(),
|
8104
8084
|
schemaFilter: union10([string8(), string8().array()]).optional().default(["public"]),
|
8105
|
-
driver: string8().optional(),
|
8106
|
-
// pg
|
8107
|
-
connectionString: string8().optional(),
|
8108
|
-
// mysql
|
8109
|
-
uri: string8().optional(),
|
8110
|
-
// turso / libsql / sqlite
|
8111
|
-
url: string8().optional(),
|
8112
|
-
host: string8().optional(),
|
8113
|
-
port: string8().optional(),
|
8114
|
-
user: string8().optional(),
|
8115
|
-
password: string8().optional(),
|
8116
|
-
database: string8().optional(),
|
8117
|
-
ssl: string8().optional(),
|
8118
|
-
authToken: string8().optional(),
|
8119
8085
|
verbose: boolean6().optional(),
|
8120
8086
|
strict: boolean6().optional()
|
8121
8087
|
}).passthrough();
|
@@ -8125,19 +8091,6 @@ var init_cli = __esm({
|
|
8125
8091
|
out: string8().optional().default("drizzle"),
|
8126
8092
|
tablesFilter: union10([string8(), string8().array()]).optional(),
|
8127
8093
|
schemaFilter: union10([string8(), string8().array()]).optional().default(["public"]),
|
8128
|
-
driver: string8().optional(),
|
8129
|
-
// mysql / pg
|
8130
|
-
connectionString: string8().optional(),
|
8131
|
-
// turso / libsql / sqlite
|
8132
|
-
uri: string8().optional(),
|
8133
|
-
host: string8().optional(),
|
8134
|
-
port: string8().optional(),
|
8135
|
-
user: string8().optional(),
|
8136
|
-
password: string8().optional(),
|
8137
|
-
database: string8().optional(),
|
8138
|
-
ssl: string8().optional(),
|
8139
|
-
url: string8().optional(),
|
8140
|
-
authToken: string8().optional(),
|
8141
8094
|
introspectCasing: casing,
|
8142
8095
|
breakpoints: boolean6().optional().default(true)
|
8143
8096
|
}).passthrough();
|