@anthonyalayo/drizzle-kit 1.2.0 → 1.2.1

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.
package/api.mjs CHANGED
@@ -24399,6 +24399,127 @@ var init_selector_ui = __esm({
24399
24399
  }
24400
24400
  });
24401
24401
 
24402
+ // ../node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js
24403
+ function camelCase(input, options) {
24404
+ if (!(typeof input === "string" || Array.isArray(input))) {
24405
+ throw new TypeError("Expected the input to be `string | string[]`");
24406
+ }
24407
+ options = {
24408
+ pascalCase: false,
24409
+ preserveConsecutiveUppercase: false,
24410
+ ...options
24411
+ };
24412
+ if (Array.isArray(input)) {
24413
+ input = input.map((x5) => x5.trim()).filter((x5) => x5.length).join("-");
24414
+ } else {
24415
+ input = input.trim();
24416
+ }
24417
+ if (input.length === 0) {
24418
+ return "";
24419
+ }
24420
+ const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
24421
+ const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
24422
+ if (input.length === 1) {
24423
+ if (SEPARATORS.test(input)) {
24424
+ return "";
24425
+ }
24426
+ return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
24427
+ }
24428
+ const hasUpperCase = input !== toLowerCase(input);
24429
+ if (hasUpperCase) {
24430
+ input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
24431
+ }
24432
+ input = input.replace(LEADING_SEPARATORS, "");
24433
+ input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
24434
+ if (options.pascalCase) {
24435
+ input = toUpperCase(input.charAt(0)) + input.slice(1);
24436
+ }
24437
+ return postProcess(input, toUpperCase);
24438
+ }
24439
+ var UPPERCASE, LOWERCASE, LEADING_CAPITAL, IDENTIFIER, SEPARATORS, LEADING_SEPARATORS, SEPARATORS_AND_IDENTIFIER, NUMBERS_AND_IDENTIFIER, preserveCamelCase, preserveConsecutiveUppercase, postProcess;
24440
+ var init_camelcase = __esm({
24441
+ "../node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js"() {
24442
+ "use strict";
24443
+ UPPERCASE = /[\p{Lu}]/u;
24444
+ LOWERCASE = /[\p{Ll}]/u;
24445
+ LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
24446
+ IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
24447
+ SEPARATORS = /[_.\- ]+/;
24448
+ LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
24449
+ SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
24450
+ NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
24451
+ preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
24452
+ let isLastCharLower = false;
24453
+ let isLastCharUpper = false;
24454
+ let isLastLastCharUpper = false;
24455
+ let isLastLastCharPreserved = false;
24456
+ for (let index6 = 0; index6 < string.length; index6++) {
24457
+ const character = string[index6];
24458
+ isLastLastCharPreserved = index6 > 2 ? string[index6 - 3] === "-" : true;
24459
+ if (isLastCharLower && UPPERCASE.test(character)) {
24460
+ string = string.slice(0, index6) + "-" + string.slice(index6);
24461
+ isLastCharLower = false;
24462
+ isLastLastCharUpper = isLastCharUpper;
24463
+ isLastCharUpper = true;
24464
+ index6++;
24465
+ } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {
24466
+ string = string.slice(0, index6 - 1) + "-" + string.slice(index6 - 1);
24467
+ isLastLastCharUpper = isLastCharUpper;
24468
+ isLastCharUpper = false;
24469
+ isLastCharLower = true;
24470
+ } else {
24471
+ isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
24472
+ isLastLastCharUpper = isLastCharUpper;
24473
+ isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
24474
+ }
24475
+ }
24476
+ return string;
24477
+ };
24478
+ preserveConsecutiveUppercase = (input, toLowerCase) => {
24479
+ LEADING_CAPITAL.lastIndex = 0;
24480
+ return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
24481
+ };
24482
+ postProcess = (input, toUpperCase) => {
24483
+ SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
24484
+ NUMBERS_AND_IDENTIFIER.lastIndex = 0;
24485
+ return input.replace(SEPARATORS_AND_IDENTIFIER, (_3, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m6) => toUpperCase(m6));
24486
+ };
24487
+ }
24488
+ });
24489
+
24490
+ // src/@types/utils.ts
24491
+ var init_utils3 = __esm({
24492
+ "src/@types/utils.ts"() {
24493
+ "use strict";
24494
+ init_camelcase();
24495
+ String.prototype.trimChar = function(char) {
24496
+ let start = 0;
24497
+ let end = this.length;
24498
+ while (start < end && this[start] === char) ++start;
24499
+ while (end > start && this[end - 1] === char) --end;
24500
+ return start > 0 || end < this.length ? this.substring(start, end) : this.toString();
24501
+ };
24502
+ String.prototype.squashSpaces = function() {
24503
+ return this.replace(/ +/g, " ").trim();
24504
+ };
24505
+ String.prototype.camelCase = function() {
24506
+ return camelCase(String(this));
24507
+ };
24508
+ String.prototype.capitalise = function() {
24509
+ return this && this.length > 0 ? `${this[0].toUpperCase()}${this.slice(1)}` : String(this);
24510
+ };
24511
+ String.prototype.concatIf = function(it, condition) {
24512
+ return condition ? `${this}${it}` : String(this);
24513
+ };
24514
+ String.prototype.snake_case = function() {
24515
+ return this && this.length > 0 ? `${this.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)}` : String(this);
24516
+ };
24517
+ Array.prototype.random = function() {
24518
+ return this[~~(Math.random() * this.length)];
24519
+ };
24520
+ }
24521
+ });
24522
+
24402
24523
  // src/serializer/sqliteSerializer.ts
24403
24524
  import { getTableName as getTableName2, is as is2, SQL as SQL2 } from "drizzle-orm";
24404
24525
  import {
@@ -25909,6 +26030,7 @@ var init_cli = __esm({
25909
26030
  schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
25910
26031
  extensionsFilters: literalType("postgis").array().optional(),
25911
26032
  casing,
26033
+ schemaSuffix: booleanType().optional(),
25912
26034
  breakpoints: booleanType().optional().default(true),
25913
26035
  migrations: objectType({
25914
26036
  prefix: prefix.optional().default("index")
@@ -26197,7 +26319,7 @@ var init_es5 = __esm({
26197
26319
 
26198
26320
  // src/cli/commands/utils.ts
26199
26321
  var import_hanji7, assertES5, InMemoryMutex, registerMutex, tsxRegistered, ensureTsxRegistered, safeRegister, migrateConfig;
26200
- var init_utils3 = __esm({
26322
+ var init_utils4 = __esm({
26201
26323
  "src/cli/commands/utils.ts"() {
26202
26324
  "use strict";
26203
26325
  import_hanji7 = __toESM(require_hanji());
@@ -26303,7 +26425,7 @@ var prepareFromExports;
26303
26425
  var init_pgImports = __esm({
26304
26426
  "src/serializer/pgImports.ts"() {
26305
26427
  "use strict";
26306
- init_utils3();
26428
+ init_utils4();
26307
26429
  prepareFromExports = (exports) => {
26308
26430
  const tables = [];
26309
26431
  const domains = [];
@@ -41564,7 +41686,7 @@ var require_semver2 = __commonJS({
41564
41686
 
41565
41687
  // src/cli/utils.ts
41566
41688
  var import_semver, checkPackage, assertPackages;
41567
- var init_utils4 = __esm({
41689
+ var init_utils5 = __esm({
41568
41690
  "src/cli/utils.ts"() {
41569
41691
  "use strict";
41570
41692
  import_semver = __toESM(require_semver2());
@@ -45767,7 +45889,7 @@ var init_evaluateRules = __esm({
45767
45889
  });
45768
45890
 
45769
45891
  // ../node_modules/.pnpm/@smithy+util-endpoints@3.0.6/node_modules/@smithy/util-endpoints/dist-es/utils/index.js
45770
- var init_utils5 = __esm({
45892
+ var init_utils6 = __esm({
45771
45893
  "../node_modules/.pnpm/@smithy+util-endpoints@3.0.6/node_modules/@smithy/util-endpoints/dist-es/utils/index.js"() {
45772
45894
  "use strict";
45773
45895
  init_customEndpointFunctions();
@@ -45782,7 +45904,7 @@ var init_resolveEndpoint = __esm({
45782
45904
  "use strict";
45783
45905
  init_debug();
45784
45906
  init_types3();
45785
- init_utils5();
45907
+ init_utils6();
45786
45908
  resolveEndpoint = (ruleSetObject, options) => {
45787
45909
  const { endpointParams, logger: logger2 } = options;
45788
45910
  const { parameters, rules } = ruleSetObject;
@@ -46396,7 +46518,7 @@ var init_getUpdatedSystemClockOffset = __esm({
46396
46518
  });
46397
46519
 
46398
46520
  // ../node_modules/.pnpm/@aws-sdk+core@3.816.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js
46399
- var init_utils6 = __esm({
46521
+ var init_utils7 = __esm({
46400
46522
  "../node_modules/.pnpm/@aws-sdk+core@3.816.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() {
46401
46523
  "use strict";
46402
46524
  init_getDateHeader();
@@ -46411,7 +46533,7 @@ var init_AwsSdkSigV4Signer = __esm({
46411
46533
  "../node_modules/.pnpm/@aws-sdk+core@3.816.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() {
46412
46534
  "use strict";
46413
46535
  init_dist_es2();
46414
- init_utils6();
46536
+ init_utils7();
46415
46537
  throwSigningPropertyError = (name, property) => {
46416
46538
  if (!property) {
46417
46539
  throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
@@ -72755,7 +72877,7 @@ var init_connections = __esm({
72755
72877
  init_wrapper();
72756
72878
  init_global();
72757
72879
  init_utils();
72758
- init_utils4();
72880
+ init_utils5();
72759
72881
  init_outputs();
72760
72882
  preparePostgresDB = async (credentials2) => {
72761
72883
  if ("driver" in credentials2) {
@@ -73791,7 +73913,7 @@ var init_studio2 = __esm({
73791
73913
  init_cors();
73792
73914
  init_global();
73793
73915
  init_esm();
73794
- init_utils3();
73916
+ init_utils4();
73795
73917
  init_serializer();
73796
73918
  init_utils2();
73797
73919
  preparePgSchema = async (path3) => {
@@ -74353,7 +74475,7 @@ var prepareFromExports2, prepareFromSqliteImports;
74353
74475
  var init_sqliteImports = __esm({
74354
74476
  "src/serializer/sqliteImports.ts"() {
74355
74477
  "use strict";
74356
- init_utils3();
74478
+ init_utils4();
74357
74479
  prepareFromExports2 = (exports) => {
74358
74480
  const tables = [];
74359
74481
  const views = [];
@@ -74397,7 +74519,7 @@ var prepareFromExports3, prepareFromMySqlImports;
74397
74519
  var init_mysqlImports = __esm({
74398
74520
  "src/serializer/mysqlImports.ts"() {
74399
74521
  "use strict";
74400
- init_utils3();
74522
+ init_utils4();
74401
74523
  prepareFromExports3 = (exports) => {
74402
74524
  const tables = [];
74403
74525
  const views = [];
@@ -74744,7 +74866,7 @@ var prepareFromExports4, prepareFromSingleStoreImports;
74744
74866
  var init_singlestoreImports = __esm({
74745
74867
  "src/serializer/singlestoreImports.ts"() {
74746
74868
  "use strict";
74747
- init_utils3();
74869
+ init_utils4();
74748
74870
  prepareFromExports4 = (exports) => {
74749
74871
  const tables = [];
74750
74872
  const i0values = Object.values(exports);
@@ -75467,119 +75589,9 @@ init_mjs();
75467
75589
  init_global();
75468
75590
 
75469
75591
  // src/introspect-sqlite.ts
75470
- import { toCamelCase as toCamelCase2 } from "drizzle-orm/casing";
75471
-
75472
- // ../node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js
75473
- var UPPERCASE = /[\p{Lu}]/u;
75474
- var LOWERCASE = /[\p{Ll}]/u;
75475
- var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
75476
- var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
75477
- var SEPARATORS = /[_.\- ]+/;
75478
- var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
75479
- var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
75480
- var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
75481
- var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
75482
- let isLastCharLower = false;
75483
- let isLastCharUpper = false;
75484
- let isLastLastCharUpper = false;
75485
- let isLastLastCharPreserved = false;
75486
- for (let index6 = 0; index6 < string.length; index6++) {
75487
- const character = string[index6];
75488
- isLastLastCharPreserved = index6 > 2 ? string[index6 - 3] === "-" : true;
75489
- if (isLastCharLower && UPPERCASE.test(character)) {
75490
- string = string.slice(0, index6) + "-" + string.slice(index6);
75491
- isLastCharLower = false;
75492
- isLastLastCharUpper = isLastCharUpper;
75493
- isLastCharUpper = true;
75494
- index6++;
75495
- } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase2)) {
75496
- string = string.slice(0, index6 - 1) + "-" + string.slice(index6 - 1);
75497
- isLastLastCharUpper = isLastCharUpper;
75498
- isLastCharUpper = false;
75499
- isLastCharLower = true;
75500
- } else {
75501
- isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
75502
- isLastLastCharUpper = isLastCharUpper;
75503
- isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
75504
- }
75505
- }
75506
- return string;
75507
- };
75508
- var preserveConsecutiveUppercase = (input, toLowerCase) => {
75509
- LEADING_CAPITAL.lastIndex = 0;
75510
- return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
75511
- };
75512
- var postProcess = (input, toUpperCase) => {
75513
- SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
75514
- NUMBERS_AND_IDENTIFIER.lastIndex = 0;
75515
- return input.replace(SEPARATORS_AND_IDENTIFIER, (_3, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m6) => toUpperCase(m6));
75516
- };
75517
- function camelCase(input, options) {
75518
- if (!(typeof input === "string" || Array.isArray(input))) {
75519
- throw new TypeError("Expected the input to be `string | string[]`");
75520
- }
75521
- options = {
75522
- pascalCase: false,
75523
- preserveConsecutiveUppercase: false,
75524
- ...options
75525
- };
75526
- if (Array.isArray(input)) {
75527
- input = input.map((x5) => x5.trim()).filter((x5) => x5.length).join("-");
75528
- } else {
75529
- input = input.trim();
75530
- }
75531
- if (input.length === 0) {
75532
- return "";
75533
- }
75534
- const toLowerCase = options.locale === false ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale);
75535
- const toUpperCase = options.locale === false ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
75536
- if (input.length === 1) {
75537
- if (SEPARATORS.test(input)) {
75538
- return "";
75539
- }
75540
- return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
75541
- }
75542
- const hasUpperCase = input !== toLowerCase(input);
75543
- if (hasUpperCase) {
75544
- input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);
75545
- }
75546
- input = input.replace(LEADING_SEPARATORS, "");
75547
- input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
75548
- if (options.pascalCase) {
75549
- input = toUpperCase(input.charAt(0)) + input.slice(1);
75550
- }
75551
- return postProcess(input, toUpperCase);
75552
- }
75553
-
75554
- // src/@types/utils.ts
75555
- String.prototype.trimChar = function(char) {
75556
- let start = 0;
75557
- let end = this.length;
75558
- while (start < end && this[start] === char) ++start;
75559
- while (end > start && this[end - 1] === char) --end;
75560
- return start > 0 || end < this.length ? this.substring(start, end) : this.toString();
75561
- };
75562
- String.prototype.squashSpaces = function() {
75563
- return this.replace(/ +/g, " ").trim();
75564
- };
75565
- String.prototype.camelCase = function() {
75566
- return camelCase(String(this));
75567
- };
75568
- String.prototype.capitalise = function() {
75569
- return this && this.length > 0 ? `${this[0].toUpperCase()}${this.slice(1)}` : String(this);
75570
- };
75571
- String.prototype.concatIf = function(it, condition) {
75572
- return condition ? `${this}${it}` : String(this);
75573
- };
75574
- String.prototype.snake_case = function() {
75575
- return this && this.length > 0 ? `${this.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`)}` : String(this);
75576
- };
75577
- Array.prototype.random = function() {
75578
- return this[~~(Math.random() * this.length)];
75579
- };
75580
-
75581
- // src/introspect-sqlite.ts
75592
+ init_utils3();
75582
75593
  init_global();
75594
+ import { toCamelCase as toCamelCase2 } from "drizzle-orm/casing";
75583
75595
 
75584
75596
  // src/cli/commands/sqliteIntrospect.ts
75585
75597
  init_sqliteSerializer();