drizzle-kit 0.20.14-c82ab68 → 0.20.14-d8f1e46

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 (45) hide show
  1. package/bin.cjs +7142 -7442
  2. package/cli/commands/migrate.d.ts +24 -24
  3. package/cli/commands/mysqlIntrospect.d.ts +8 -8
  4. package/cli/commands/mysqlPushUtils.d.ts +2 -2
  5. package/cli/commands/mysqlUp.d.ts +2 -2
  6. package/cli/commands/pgConnect.d.ts +1 -1
  7. package/cli/commands/pgIntrospect.d.ts +9 -12
  8. package/cli/commands/pgPushUtils.d.ts +2 -2
  9. package/cli/commands/pgUp.d.ts +2 -2
  10. package/cli/commands/sqliteIntrospect.d.ts +9 -9
  11. package/cli/commands/sqlitePushUtils.d.ts +3 -3
  12. package/cli/commands/sqliteUtils.d.ts +162 -0
  13. package/cli/commands/upFolders.d.ts +1 -1
  14. package/cli/commands/utils.d.ts +259 -14
  15. package/cli/validations/common.d.ts +7 -205
  16. package/cli/validations/mysql.d.ts +1 -6
  17. package/cli/validations/pg.d.ts +1 -6
  18. package/cli/views.d.ts +1 -1
  19. package/global.d.ts +1 -1
  20. package/index.d.mts +6 -8
  21. package/index.d.ts +6 -8
  22. package/index.js +0 -1
  23. package/introspect-mysql.d.ts +1 -1
  24. package/introspect-pg.d.ts +2 -5
  25. package/introspect-sqlite.d.ts +1 -1
  26. package/jsonStatements.d.ts +1 -1
  27. package/package.json +2 -3
  28. package/payload.d.mts +988 -18
  29. package/payload.d.ts +988 -18
  30. package/payload.js +1616 -13426
  31. package/payload.mjs +1538 -2213
  32. package/schemaValidator.d.ts +40 -40
  33. package/serializer/mysqlSchema.d.ts +616 -1854
  34. package/serializer/mysqlSerializer.d.ts +2 -2
  35. package/serializer/pgSchema.d.ts +684 -1009
  36. package/serializer/sqliteSchema.d.ts +570 -144
  37. package/serializer/sqliteSerializer.d.ts +2 -2
  38. package/snapshotsDiffer.d.ts +20 -24
  39. package/utils-studio.js +15 -390
  40. package/utils-studio.mjs +15 -389
  41. package/utils.d.ts +12 -12
  42. package/utils.js +735 -849
  43. package/utils.mjs +736 -849
  44. package/cli/validations/cli.d.ts +0 -104
  45. package/cli/validations/sqlite.d.ts +0 -382
@@ -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 "../cli/views";
4
- import type { DrizzleDbClient } from "../drivers";
3
+ import type { IntrospectStage, IntrospectStatus } from "src/cli/views";
4
+ import type { DrizzleDbClient } from "src/drivers";
5
5
  export declare const generateSqliteSnapshot: (tables: AnySQLiteTable[], enums: any[]) => SQLiteSchemaInternal;
6
6
  export declare const fromDatabase: (db: DrizzleDbClient, tablesFilter?: (table: string) => boolean, progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<SQLiteSchemaInternal>;
@@ -1,9 +1,6 @@
1
1
  import { TypeOf, ZodTypeAny, z } from "zod";
2
2
  import { JsonStatement } from "./jsonStatements";
3
- import { CommonSquashedSchema } from "./schemaValidator";
4
- import { SQLiteSchema } from "./serializer/sqliteSchema";
5
- import { MySqlSchema } from "./serializer/mysqlSchema";
6
- import { PgSchema } from "./serializer/pgSchema";
3
+ import { CommonSquashedSchema, Dialect } from "./schemaValidator";
7
4
  export declare const makePatched: <T extends ZodTypeAny>(schema: T) => z.ZodUnion<[z.ZodObject<{
8
5
  type: z.ZodLiteral<"added">;
9
6
  value: T;
@@ -57,19 +54,19 @@ export declare const makePatched: <T extends ZodTypeAny>(schema: T) => z.ZodUnio
57
54
  }>[k_3_2]; } : never>]>;
58
55
  export declare const makeSelfOrPatched: <T extends ZodTypeAny>(schema: T) => z.ZodUnion<[z.ZodObject<{
59
56
  type: z.ZodLiteral<"none">;
60
- value: T;
57
+ value: z.ZodOptional<T>;
61
58
  }, "strip", ZodTypeAny, z.objectUtil.addQuestionMarks<{
62
59
  type: "none";
63
- value: T["_output"];
60
+ value: T["_output"] | undefined;
64
61
  }> extends infer T_1 ? { [k_1 in keyof T_1]: z.objectUtil.addQuestionMarks<{
65
62
  type: "none";
66
- value: T["_output"];
63
+ value: T["_output"] | undefined;
67
64
  }>[k_1]; } : never, z.objectUtil.addQuestionMarks<{
68
65
  type: "none";
69
- value: T["_input"];
66
+ value: T["_input"] | undefined;
70
67
  }> extends infer T_2 ? { [k_3 in keyof T_2]: z.objectUtil.addQuestionMarks<{
71
68
  type: "none";
72
- value: T["_input"];
69
+ value: T["_input"] | undefined;
73
70
  }>[k_3]; } : never>, z.ZodObject<{
74
71
  type: z.ZodLiteral<"added">;
75
72
  value: T;
@@ -564,13 +561,13 @@ export declare const alteredTableScheme: z.ZodObject<{
564
561
  name: z.ZodString;
565
562
  schema: z.ZodUnion<[z.ZodObject<{
566
563
  type: z.ZodLiteral<"none">;
567
- value: z.ZodString;
564
+ value: z.ZodOptional<z.ZodString>;
568
565
  }, "strip", ZodTypeAny, {
566
+ value?: string | undefined;
569
567
  type: "none";
570
- value: string;
571
568
  }, {
569
+ value?: string | undefined;
572
570
  type: "none";
573
- value: string;
574
571
  }>, z.ZodObject<{
575
572
  type: z.ZodLiteral<"added">;
576
573
  value: z.ZodString;
@@ -1036,8 +1033,8 @@ export declare const alteredTableScheme: z.ZodObject<{
1036
1033
  }, "strict", ZodTypeAny, {
1037
1034
  name: string;
1038
1035
  schema: {
1036
+ value?: string | undefined;
1039
1037
  type: "none";
1040
- value: string;
1041
1038
  } | {
1042
1039
  type: "added";
1043
1040
  value: string;
@@ -1167,8 +1164,8 @@ export declare const alteredTableScheme: z.ZodObject<{
1167
1164
  }, {
1168
1165
  name: string;
1169
1166
  schema: {
1167
+ value?: string | undefined;
1170
1168
  type: "none";
1171
- value: string;
1172
1169
  } | {
1173
1170
  type: "added";
1174
1171
  value: string;
@@ -1461,13 +1458,13 @@ export declare const diffResultScheme: z.ZodObject<{
1461
1458
  name: z.ZodString;
1462
1459
  schema: z.ZodUnion<[z.ZodObject<{
1463
1460
  type: z.ZodLiteral<"none">;
1464
- value: z.ZodString;
1461
+ value: z.ZodOptional<z.ZodString>;
1465
1462
  }, "strip", ZodTypeAny, {
1463
+ value?: string | undefined;
1466
1464
  type: "none";
1467
- value: string;
1468
1465
  }, {
1466
+ value?: string | undefined;
1469
1467
  type: "none";
1470
- value: string;
1471
1468
  }>, z.ZodObject<{
1472
1469
  type: z.ZodLiteral<"added">;
1473
1470
  value: z.ZodString;
@@ -1933,8 +1930,8 @@ export declare const diffResultScheme: z.ZodObject<{
1933
1930
  }, "strict", ZodTypeAny, {
1934
1931
  name: string;
1935
1932
  schema: {
1933
+ value?: string | undefined;
1936
1934
  type: "none";
1937
- value: string;
1938
1935
  } | {
1939
1936
  type: "added";
1940
1937
  value: string;
@@ -2064,8 +2061,8 @@ export declare const diffResultScheme: z.ZodObject<{
2064
2061
  }, {
2065
2062
  name: string;
2066
2063
  schema: {
2064
+ value?: string | undefined;
2067
2065
  type: "none";
2068
- value: string;
2069
2066
  } | {
2070
2067
  type: "added";
2071
2068
  value: string;
@@ -2272,8 +2269,8 @@ export declare const diffResultScheme: z.ZodObject<{
2272
2269
  alteredTablesWithColumns: {
2273
2270
  name: string;
2274
2271
  schema: {
2272
+ value?: string | undefined;
2275
2273
  type: "none";
2276
- value: string;
2277
2274
  } | {
2278
2275
  type: "added";
2279
2276
  value: string;
@@ -2460,8 +2457,8 @@ export declare const diffResultScheme: z.ZodObject<{
2460
2457
  alteredTablesWithColumns: {
2461
2458
  name: string;
2462
2459
  schema: {
2460
+ value?: string | undefined;
2463
2461
  type: "none";
2464
- value: string;
2465
2462
  } | {
2466
2463
  type: "added";
2467
2464
  value: string;
@@ -2647,12 +2644,11 @@ export interface ColumnsResolverOutput<T extends {
2647
2644
  }[];
2648
2645
  deleted: T[];
2649
2646
  }
2650
- export type SchemaFrom<D> = D extends "pg" ? PgSchema : D extends "mysql" ? MySqlSchema : D extends "sqlite" ? SQLiteSchema : undefined;
2651
- export declare const applySnapshotsDiff: <DIALECT extends "mysql" | "pg" | "sqlite" = "mysql" | "pg" | "sqlite">(json1: CommonSquashedSchema, json2: CommonSquashedSchema, dialect: DIALECT, schemasResolver: (input: TablesResolverInput<{
2647
+ export declare const applySnapshotsDiff: (json1: CommonSquashedSchema, json2: CommonSquashedSchema, dialect: Dialect, schemasResolver: (input: TablesResolverInput<{
2652
2648
  name: string;
2653
2649
  }>) => Promise<TablesResolverOutput<{
2654
2650
  name: string;
2655
- }>>, tablesResolver: (input: TablesResolverInput<Table>) => Promise<TablesResolverOutput<Table>>, columnsResolver: (input: ColumnsResolverInput<Column>) => Promise<ColumnsResolverOutput<Column>>, prevFull: SchemaFrom<DIALECT>, curFull: SchemaFrom<DIALECT>) => Promise<{
2651
+ }>>, tablesResolver: (input: TablesResolverInput<Table>) => Promise<TablesResolverOutput<Table>>, columnsResolver: (input: ColumnsResolverInput<Column>) => Promise<ColumnsResolverOutput<Column>>, prevFull?: any, curFull?: any) => Promise<{
2656
2652
  statements: JsonStatement[];
2657
2653
  sqlStatements: string[];
2658
2654
  _meta: {
package/utils-studio.js CHANGED
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1077,26 +1076,15 @@ var require_hanji = __commonJS({
1077
1076
  var import_hanji;
1078
1077
  var init_views = __esm({
1079
1078
  "src/cli/views.ts"() {
1080
- "use strict";
1081
1079
  init_source();
1082
1080
  import_hanji = __toESM(require_hanji());
1083
1081
  }
1084
1082
  });
1085
1083
 
1086
- // src/global.ts
1087
- var originUUID;
1088
- var init_global = __esm({
1089
- "src/global.ts"() {
1090
- "use strict";
1091
- originUUID = "00000000-0000-0000-0000-000000000000";
1092
- }
1093
- });
1094
-
1095
1084
  // src/serializer/index.ts
1096
1085
  var glob;
1097
1086
  var init_serializer = __esm({
1098
1087
  "src/serializer/index.ts"() {
1099
- "use strict";
1100
1088
  glob = __toESM(require("glob"));
1101
1089
  init_source();
1102
1090
  init_views();
@@ -1106,14 +1094,12 @@ var init_serializer = __esm({
1106
1094
  // src/cli/validations/outputs.ts
1107
1095
  var init_outputs = __esm({
1108
1096
  "src/cli/validations/outputs.ts"() {
1109
- "use strict";
1110
1097
  init_source();
1111
1098
  }
1112
1099
  });
1113
1100
 
1114
1101
  // src/serializer/sqliteSerializer.ts
1115
1102
  function mapSqlToSqliteType(sqlType) {
1116
- const lowered = sqlType.toLowerCase();
1117
1103
  if ([
1118
1104
  "int",
1119
1105
  "integer",
@@ -1125,27 +1111,24 @@ function mapSqlToSqliteType(sqlType) {
1125
1111
  "unsigned big int",
1126
1112
  "int2",
1127
1113
  "int8"
1128
- ].some((it) => lowered.startsWith(it))) {
1114
+ ].includes(sqlType.toLowerCase())) {
1129
1115
  return "integer";
1130
1116
  } else if ([
1131
1117
  "character",
1132
1118
  "varchar",
1133
- "varying character",
1134
- "national varying character",
1119
+ "vatying character",
1135
1120
  "nchar",
1136
1121
  "native character",
1137
1122
  "nvarchar",
1138
1123
  "text",
1139
1124
  "clob"
1140
- ].some((it) => lowered.startsWith(it))) {
1141
- const match2 = lowered.match(/\d+/);
1142
- if (match2) {
1143
- return `text(${match2[0]})`;
1144
- }
1125
+ ].some((it) => it.startsWith(sqlType.toLowerCase()))) {
1145
1126
  return "text";
1146
- } else if (lowered.startsWith("blob")) {
1127
+ } else if (sqlType.toLowerCase() === "blob") {
1147
1128
  return "blob";
1148
- } else if (["real", "double", "double precision", "float"].some((it) => lowered.startsWith(it))) {
1129
+ } else if (["real", "double", "double precision", "float"].includes(
1130
+ sqlType.toLowerCase()
1131
+ )) {
1149
1132
  return "real";
1150
1133
  } else {
1151
1134
  return "numeric";
@@ -1154,7 +1137,6 @@ function mapSqlToSqliteType(sqlType) {
1154
1137
  var import_drizzle_orm, import_sqlite_core2, dialect, fromDatabase;
1155
1138
  var init_sqliteSerializer = __esm({
1156
1139
  "src/serializer/sqliteSerializer.ts"() {
1157
- "use strict";
1158
1140
  import_drizzle_orm = require("drizzle-orm");
1159
1141
  import_sqlite_core2 = require("drizzle-orm/sqlite-core");
1160
1142
  init_serializer();
@@ -1573,7 +1555,6 @@ var require_brace_expansion = __commonJS({
1573
1555
  var import_pg_core2, import_pg_core3, import_drizzle_orm2, dialect2, trimChar, fromDatabase2, columnToDefault, defaultForColumn;
1574
1556
  var init_pgSerializer = __esm({
1575
1557
  "src/serializer/pgSerializer.ts"() {
1576
- "use strict";
1577
1558
  import_pg_core2 = require("drizzle-orm/pg-core");
1578
1559
  import_pg_core3 = require("drizzle-orm/pg-core");
1579
1560
  import_drizzle_orm2 = require("drizzle-orm");
@@ -1590,7 +1571,7 @@ var init_pgSerializer = __esm({
1590
1571
  --end;
1591
1572
  return start > 0 || end < str.length ? str.substring(start, end) : str.toString();
1592
1573
  };
1593
- fromDatabase2 = async (db, tablesFilter = () => true, schemaFilters, progressCallback) => {
1574
+ fromDatabase2 = async (db, tablesFilter = (table) => true, schemaFilters, progressCallback) => {
1594
1575
  const result = {};
1595
1576
  const internals = { tables: {} };
1596
1577
  const where = schemaFilters.map((t) => `table_schema = '${t}'`).join(" or ");
@@ -1917,7 +1898,7 @@ var init_pgSerializer = __esm({
1917
1898
  }
1918
1899
  const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
1919
1900
  return {
1920
- version: "6",
1901
+ version: "5",
1921
1902
  dialect: "pg",
1922
1903
  tables: result,
1923
1904
  enums: enumsToReturn,
@@ -1989,368 +1970,10 @@ var init_pgSerializer = __esm({
1989
1970
  }
1990
1971
  });
1991
1972
 
1992
- // node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js
1993
- var require_pluralize = __commonJS({
1994
- "node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js"(exports, module2) {
1995
- (function(root, pluralize) {
1996
- if (typeof require === "function" && typeof exports === "object" && typeof module2 === "object") {
1997
- module2.exports = pluralize();
1998
- } else if (typeof define === "function" && define.amd) {
1999
- define(function() {
2000
- return pluralize();
2001
- });
2002
- } else {
2003
- root.pluralize = pluralize();
2004
- }
2005
- })(exports, function() {
2006
- var pluralRules = [];
2007
- var singularRules = [];
2008
- var uncountables = {};
2009
- var irregularPlurals = {};
2010
- var irregularSingles = {};
2011
- function sanitizeRule(rule) {
2012
- if (typeof rule === "string") {
2013
- return new RegExp("^" + rule + "$", "i");
2014
- }
2015
- return rule;
2016
- }
2017
- function restoreCase(word, token) {
2018
- if (word === token)
2019
- return token;
2020
- if (word === word.toLowerCase())
2021
- return token.toLowerCase();
2022
- if (word === word.toUpperCase())
2023
- return token.toUpperCase();
2024
- if (word[0] === word[0].toUpperCase()) {
2025
- return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
2026
- }
2027
- return token.toLowerCase();
2028
- }
2029
- function interpolate(str, args) {
2030
- return str.replace(/\$(\d{1,2})/g, function(match2, index) {
2031
- return args[index] || "";
2032
- });
2033
- }
2034
- function replace(word, rule) {
2035
- return word.replace(rule[0], function(match2, index) {
2036
- var result = interpolate(rule[1], arguments);
2037
- if (match2 === "") {
2038
- return restoreCase(word[index - 1], result);
2039
- }
2040
- return restoreCase(match2, result);
2041
- });
2042
- }
2043
- function sanitizeWord(token, word, rules) {
2044
- if (!token.length || uncountables.hasOwnProperty(token)) {
2045
- return word;
2046
- }
2047
- var len = rules.length;
2048
- while (len--) {
2049
- var rule = rules[len];
2050
- if (rule[0].test(word))
2051
- return replace(word, rule);
2052
- }
2053
- return word;
2054
- }
2055
- function replaceWord(replaceMap, keepMap, rules) {
2056
- return function(word) {
2057
- var token = word.toLowerCase();
2058
- if (keepMap.hasOwnProperty(token)) {
2059
- return restoreCase(word, token);
2060
- }
2061
- if (replaceMap.hasOwnProperty(token)) {
2062
- return restoreCase(word, replaceMap[token]);
2063
- }
2064
- return sanitizeWord(token, word, rules);
2065
- };
2066
- }
2067
- function checkWord(replaceMap, keepMap, rules, bool) {
2068
- return function(word) {
2069
- var token = word.toLowerCase();
2070
- if (keepMap.hasOwnProperty(token))
2071
- return true;
2072
- if (replaceMap.hasOwnProperty(token))
2073
- return false;
2074
- return sanitizeWord(token, token, rules) === token;
2075
- };
2076
- }
2077
- function pluralize(word, count, inclusive) {
2078
- var pluralized = count === 1 ? pluralize.singular(word) : pluralize.plural(word);
2079
- return (inclusive ? count + " " : "") + pluralized;
2080
- }
2081
- pluralize.plural = replaceWord(
2082
- irregularSingles,
2083
- irregularPlurals,
2084
- pluralRules
2085
- );
2086
- pluralize.isPlural = checkWord(
2087
- irregularSingles,
2088
- irregularPlurals,
2089
- pluralRules
2090
- );
2091
- pluralize.singular = replaceWord(
2092
- irregularPlurals,
2093
- irregularSingles,
2094
- singularRules
2095
- );
2096
- pluralize.isSingular = checkWord(
2097
- irregularPlurals,
2098
- irregularSingles,
2099
- singularRules
2100
- );
2101
- pluralize.addPluralRule = function(rule, replacement) {
2102
- pluralRules.push([sanitizeRule(rule), replacement]);
2103
- };
2104
- pluralize.addSingularRule = function(rule, replacement) {
2105
- singularRules.push([sanitizeRule(rule), replacement]);
2106
- };
2107
- pluralize.addUncountableRule = function(word) {
2108
- if (typeof word === "string") {
2109
- uncountables[word.toLowerCase()] = true;
2110
- return;
2111
- }
2112
- pluralize.addPluralRule(word, "$0");
2113
- pluralize.addSingularRule(word, "$0");
2114
- };
2115
- pluralize.addIrregularRule = function(single, plural2) {
2116
- plural2 = plural2.toLowerCase();
2117
- single = single.toLowerCase();
2118
- irregularSingles[single] = plural2;
2119
- irregularPlurals[plural2] = single;
2120
- };
2121
- [
2122
- // Pronouns.
2123
- ["I", "we"],
2124
- ["me", "us"],
2125
- ["he", "they"],
2126
- ["she", "they"],
2127
- ["them", "them"],
2128
- ["myself", "ourselves"],
2129
- ["yourself", "yourselves"],
2130
- ["itself", "themselves"],
2131
- ["herself", "themselves"],
2132
- ["himself", "themselves"],
2133
- ["themself", "themselves"],
2134
- ["is", "are"],
2135
- ["was", "were"],
2136
- ["has", "have"],
2137
- ["this", "these"],
2138
- ["that", "those"],
2139
- // Words ending in with a consonant and `o`.
2140
- ["echo", "echoes"],
2141
- ["dingo", "dingoes"],
2142
- ["volcano", "volcanoes"],
2143
- ["tornado", "tornadoes"],
2144
- ["torpedo", "torpedoes"],
2145
- // Ends with `us`.
2146
- ["genus", "genera"],
2147
- ["viscus", "viscera"],
2148
- // Ends with `ma`.
2149
- ["stigma", "stigmata"],
2150
- ["stoma", "stomata"],
2151
- ["dogma", "dogmata"],
2152
- ["lemma", "lemmata"],
2153
- ["schema", "schemata"],
2154
- ["anathema", "anathemata"],
2155
- // Other irregular rules.
2156
- ["ox", "oxen"],
2157
- ["axe", "axes"],
2158
- ["die", "dice"],
2159
- ["yes", "yeses"],
2160
- ["foot", "feet"],
2161
- ["eave", "eaves"],
2162
- ["goose", "geese"],
2163
- ["tooth", "teeth"],
2164
- ["quiz", "quizzes"],
2165
- ["human", "humans"],
2166
- ["proof", "proofs"],
2167
- ["carve", "carves"],
2168
- ["valve", "valves"],
2169
- ["looey", "looies"],
2170
- ["thief", "thieves"],
2171
- ["groove", "grooves"],
2172
- ["pickaxe", "pickaxes"],
2173
- ["passerby", "passersby"]
2174
- ].forEach(function(rule) {
2175
- return pluralize.addIrregularRule(rule[0], rule[1]);
2176
- });
2177
- [
2178
- [/s?$/i, "s"],
2179
- [/[^\u0000-\u007F]$/i, "$0"],
2180
- [/([^aeiou]ese)$/i, "$1"],
2181
- [/(ax|test)is$/i, "$1es"],
2182
- [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"],
2183
- [/(e[mn]u)s?$/i, "$1s"],
2184
- [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"],
2185
- [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"],
2186
- [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"],
2187
- [/(seraph|cherub)(?:im)?$/i, "$1im"],
2188
- [/(her|at|gr)o$/i, "$1oes"],
2189
- [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"],
2190
- [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"],
2191
- [/sis$/i, "ses"],
2192
- [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"],
2193
- [/([^aeiouy]|qu)y$/i, "$1ies"],
2194
- [/([^ch][ieo][ln])ey$/i, "$1ies"],
2195
- [/(x|ch|ss|sh|zz)$/i, "$1es"],
2196
- [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"],
2197
- [/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"],
2198
- [/(pe)(?:rson|ople)$/i, "$1ople"],
2199
- [/(child)(?:ren)?$/i, "$1ren"],
2200
- [/eaux$/i, "$0"],
2201
- [/m[ae]n$/i, "men"],
2202
- ["thou", "you"]
2203
- ].forEach(function(rule) {
2204
- return pluralize.addPluralRule(rule[0], rule[1]);
2205
- });
2206
- [
2207
- [/s$/i, ""],
2208
- [/(ss)$/i, "$1"],
2209
- [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"],
2210
- [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"],
2211
- [/ies$/i, "y"],
2212
- [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"],
2213
- [/\b(mon|smil)ies$/i, "$1ey"],
2214
- [/\b((?:tit)?m|l)ice$/i, "$1ouse"],
2215
- [/(seraph|cherub)im$/i, "$1"],
2216
- [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"],
2217
- [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"],
2218
- [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"],
2219
- [/(test)(?:is|es)$/i, "$1is"],
2220
- [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"],
2221
- [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"],
2222
- [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"],
2223
- [/(alumn|alg|vertebr)ae$/i, "$1a"],
2224
- [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"],
2225
- [/(matr|append)ices$/i, "$1ix"],
2226
- [/(pe)(rson|ople)$/i, "$1rson"],
2227
- [/(child)ren$/i, "$1"],
2228
- [/(eau)x?$/i, "$1"],
2229
- [/men$/i, "man"]
2230
- ].forEach(function(rule) {
2231
- return pluralize.addSingularRule(rule[0], rule[1]);
2232
- });
2233
- [
2234
- // Singular words with no plurals.
2235
- "adulthood",
2236
- "advice",
2237
- "agenda",
2238
- "aid",
2239
- "aircraft",
2240
- "alcohol",
2241
- "ammo",
2242
- "analytics",
2243
- "anime",
2244
- "athletics",
2245
- "audio",
2246
- "bison",
2247
- "blood",
2248
- "bream",
2249
- "buffalo",
2250
- "butter",
2251
- "carp",
2252
- "cash",
2253
- "chassis",
2254
- "chess",
2255
- "clothing",
2256
- "cod",
2257
- "commerce",
2258
- "cooperation",
2259
- "corps",
2260
- "debris",
2261
- "diabetes",
2262
- "digestion",
2263
- "elk",
2264
- "energy",
2265
- "equipment",
2266
- "excretion",
2267
- "expertise",
2268
- "firmware",
2269
- "flounder",
2270
- "fun",
2271
- "gallows",
2272
- "garbage",
2273
- "graffiti",
2274
- "hardware",
2275
- "headquarters",
2276
- "health",
2277
- "herpes",
2278
- "highjinks",
2279
- "homework",
2280
- "housework",
2281
- "information",
2282
- "jeans",
2283
- "justice",
2284
- "kudos",
2285
- "labour",
2286
- "literature",
2287
- "machinery",
2288
- "mackerel",
2289
- "mail",
2290
- "media",
2291
- "mews",
2292
- "moose",
2293
- "music",
2294
- "mud",
2295
- "manga",
2296
- "news",
2297
- "only",
2298
- "personnel",
2299
- "pike",
2300
- "plankton",
2301
- "pliers",
2302
- "police",
2303
- "pollution",
2304
- "premises",
2305
- "rain",
2306
- "research",
2307
- "rice",
2308
- "salmon",
2309
- "scissors",
2310
- "series",
2311
- "sewage",
2312
- "shambles",
2313
- "shrimp",
2314
- "software",
2315
- "species",
2316
- "staff",
2317
- "swine",
2318
- "tennis",
2319
- "traffic",
2320
- "transportation",
2321
- "trout",
2322
- "tuna",
2323
- "wealth",
2324
- "welfare",
2325
- "whiting",
2326
- "wildebeest",
2327
- "wildlife",
2328
- "you",
2329
- /pok[eé]mon$/i,
2330
- // Regexes.
2331
- /[^aeiou]ese$/i,
2332
- // "chinese", "japanese"
2333
- /deer$/i,
2334
- // "deer", "reindeer"
2335
- /fish$/i,
2336
- // "fish", "blowfish", "angelfish"
2337
- /measles$/i,
2338
- /o[iu]s$/i,
2339
- // "carnivorous"
2340
- /pox$/i,
2341
- // "chickpox", "smallpox"
2342
- /sheep$/i
2343
- ].forEach(pluralize.addUncountableRule);
2344
- return pluralize;
2345
- });
2346
- }
2347
- });
2348
-
2349
1973
  // src/drivers/index.ts
2350
1974
  var import_drizzle_orm4, DrizzleDbClient, DrizzleORMPgClient, TursoSqlite;
2351
1975
  var init_drivers = __esm({
2352
1976
  "src/drivers/index.ts"() {
2353
- "use strict";
2354
1977
  import_drizzle_orm4 = require("drizzle-orm");
2355
1978
  DrizzleDbClient = class {
2356
1979
  constructor(db) {
@@ -2543,7 +2166,11 @@ var sqliteSchemaToDrizzle = (schema) => {
2543
2166
 
2544
2167
  // src/cli/commands/sqliteIntrospect.ts
2545
2168
  init_views();
2546
- init_global();
2169
+
2170
+ // src/global.ts
2171
+ var originUUID = "00000000-0000-0000-0000-000000000000";
2172
+
2173
+ // src/cli/commands/sqliteIntrospect.ts
2547
2174
  init_sqliteSerializer();
2548
2175
 
2549
2176
  // node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js
@@ -2645,7 +2272,7 @@ String.prototype.camelCase = function() {
2645
2272
  return camelCase(String(this));
2646
2273
  };
2647
2274
  String.prototype.concatIf = function(it, condition) {
2648
- return condition ? `${this}${it}` : String(this);
2275
+ return condition ? `${this}${it}` : this;
2649
2276
  };
2650
2277
  Array.prototype.random = function() {
2651
2278
  return this[~~(Math.random() * this.length)];
@@ -3725,12 +3352,10 @@ init_pgSerializer();
3725
3352
 
3726
3353
  // src/introspect-pg.ts
3727
3354
  var import_drizzle_orm3 = require("drizzle-orm");
3728
- var import_pluralize = __toESM(require_pluralize());
3729
3355
  var import_relations = require("drizzle-orm/relations");
3730
3356
  init_pgSerializer();
3731
3357
 
3732
3358
  // src/cli/commands/pgIntrospect.ts
3733
- init_global();
3734
3359
  var pgPushIntrospect = async (connection, filters, schemaFilters) => {
3735
3360
  const { client } = connection;
3736
3361
  const matchers = filters.map((it) => {