drizzle-kit 0.20.14-a77266f → 0.20.14-c82ab68
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/bin.cjs +7311 -7010
- package/cli/commands/migrate.d.ts +24 -24
- package/cli/commands/mysqlIntrospect.d.ts +8 -8
- package/cli/commands/mysqlPushUtils.d.ts +2 -2
- package/cli/commands/mysqlUp.d.ts +2 -2
- package/cli/commands/pgConnect.d.ts +1 -1
- package/cli/commands/pgIntrospect.d.ts +12 -9
- package/cli/commands/pgPushUtils.d.ts +2 -2
- package/cli/commands/pgUp.d.ts +2 -2
- package/cli/commands/sqliteIntrospect.d.ts +9 -9
- package/cli/commands/sqlitePushUtils.d.ts +3 -3
- package/cli/commands/upFolders.d.ts +1 -1
- package/cli/commands/utils.d.ts +14 -259
- package/cli/validations/cli.d.ts +104 -0
- package/cli/validations/common.d.ts +205 -7
- package/cli/validations/mysql.d.ts +6 -1
- package/cli/validations/pg.d.ts +6 -1
- package/cli/validations/sqlite.d.ts +382 -0
- package/cli/views.d.ts +1 -1
- package/global.d.ts +1 -1
- package/index.d.mts +8 -6
- package/index.d.ts +8 -6
- package/index.js +1 -0
- package/introspect-mysql.d.ts +1 -1
- package/introspect-pg.d.ts +5 -2
- package/introspect-sqlite.d.ts +1 -1
- package/jsonStatements.d.ts +1 -1
- package/package.json +3 -1
- package/payload.js +2574 -1898
- package/payload.mjs +2570 -1895
- package/schemaValidator.d.ts +40 -40
- package/serializer/mysqlSchema.d.ts +1991 -753
- package/serializer/mysqlSerializer.d.ts +2 -2
- package/serializer/pgSchema.d.ts +1113 -788
- package/serializer/sqliteSchema.d.ts +144 -570
- package/serializer/sqliteSerializer.d.ts +2 -2
- package/snapshotsDiffer.d.ts +24 -20
- package/utils-studio.js +390 -15
- package/utils-studio.mjs +389 -15
- package/utils.d.ts +12 -12
- package/utils.js +849 -735
- package/utils.mjs +849 -736
- package/cli/commands/sqliteUtils.d.ts +0 -162
package/utils-studio.mjs
CHANGED
|
@@ -1078,15 +1078,26 @@ var require_hanji = __commonJS({
|
|
|
1078
1078
|
var import_hanji;
|
|
1079
1079
|
var init_views = __esm({
|
|
1080
1080
|
"src/cli/views.ts"() {
|
|
1081
|
+
"use strict";
|
|
1081
1082
|
init_source();
|
|
1082
1083
|
import_hanji = __toESM(require_hanji());
|
|
1083
1084
|
}
|
|
1084
1085
|
});
|
|
1085
1086
|
|
|
1087
|
+
// src/global.ts
|
|
1088
|
+
var originUUID;
|
|
1089
|
+
var init_global = __esm({
|
|
1090
|
+
"src/global.ts"() {
|
|
1091
|
+
"use strict";
|
|
1092
|
+
originUUID = "00000000-0000-0000-0000-000000000000";
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
|
|
1086
1096
|
// src/serializer/index.ts
|
|
1087
1097
|
import * as glob from "glob";
|
|
1088
1098
|
var init_serializer = __esm({
|
|
1089
1099
|
"src/serializer/index.ts"() {
|
|
1100
|
+
"use strict";
|
|
1090
1101
|
init_source();
|
|
1091
1102
|
init_views();
|
|
1092
1103
|
}
|
|
@@ -1095,6 +1106,7 @@ var init_serializer = __esm({
|
|
|
1095
1106
|
// src/cli/validations/outputs.ts
|
|
1096
1107
|
var init_outputs = __esm({
|
|
1097
1108
|
"src/cli/validations/outputs.ts"() {
|
|
1109
|
+
"use strict";
|
|
1098
1110
|
init_source();
|
|
1099
1111
|
}
|
|
1100
1112
|
});
|
|
@@ -1108,6 +1120,7 @@ import {
|
|
|
1108
1120
|
uniqueKeyName
|
|
1109
1121
|
} from "drizzle-orm/sqlite-core";
|
|
1110
1122
|
function mapSqlToSqliteType(sqlType) {
|
|
1123
|
+
const lowered = sqlType.toLowerCase();
|
|
1111
1124
|
if ([
|
|
1112
1125
|
"int",
|
|
1113
1126
|
"integer",
|
|
@@ -1119,24 +1132,27 @@ function mapSqlToSqliteType(sqlType) {
|
|
|
1119
1132
|
"unsigned big int",
|
|
1120
1133
|
"int2",
|
|
1121
1134
|
"int8"
|
|
1122
|
-
].
|
|
1135
|
+
].some((it) => lowered.startsWith(it))) {
|
|
1123
1136
|
return "integer";
|
|
1124
1137
|
} else if ([
|
|
1125
1138
|
"character",
|
|
1126
1139
|
"varchar",
|
|
1127
|
-
"
|
|
1140
|
+
"varying character",
|
|
1141
|
+
"national varying character",
|
|
1128
1142
|
"nchar",
|
|
1129
1143
|
"native character",
|
|
1130
1144
|
"nvarchar",
|
|
1131
1145
|
"text",
|
|
1132
1146
|
"clob"
|
|
1133
|
-
].some((it) =>
|
|
1147
|
+
].some((it) => lowered.startsWith(it))) {
|
|
1148
|
+
const match2 = lowered.match(/\d+/);
|
|
1149
|
+
if (match2) {
|
|
1150
|
+
return `text(${match2[0]})`;
|
|
1151
|
+
}
|
|
1134
1152
|
return "text";
|
|
1135
|
-
} else if (
|
|
1153
|
+
} else if (lowered.startsWith("blob")) {
|
|
1136
1154
|
return "blob";
|
|
1137
|
-
} else if (["real", "double", "double precision", "float"].
|
|
1138
|
-
sqlType.toLowerCase()
|
|
1139
|
-
)) {
|
|
1155
|
+
} else if (["real", "double", "double precision", "float"].some((it) => lowered.startsWith(it))) {
|
|
1140
1156
|
return "real";
|
|
1141
1157
|
} else {
|
|
1142
1158
|
return "numeric";
|
|
@@ -1145,6 +1161,7 @@ function mapSqlToSqliteType(sqlType) {
|
|
|
1145
1161
|
var dialect, fromDatabase;
|
|
1146
1162
|
var init_sqliteSerializer = __esm({
|
|
1147
1163
|
"src/serializer/sqliteSerializer.ts"() {
|
|
1164
|
+
"use strict";
|
|
1148
1165
|
init_serializer();
|
|
1149
1166
|
init_outputs();
|
|
1150
1167
|
init_source();
|
|
@@ -1567,6 +1584,7 @@ import { is as is2, SQL as SQL2, getTableName as getTableName2 } from "drizzle-o
|
|
|
1567
1584
|
var dialect2, trimChar, fromDatabase2, columnToDefault, defaultForColumn;
|
|
1568
1585
|
var init_pgSerializer = __esm({
|
|
1569
1586
|
"src/serializer/pgSerializer.ts"() {
|
|
1587
|
+
"use strict";
|
|
1570
1588
|
init_serializer();
|
|
1571
1589
|
init_source();
|
|
1572
1590
|
init_outputs();
|
|
@@ -1580,7 +1598,7 @@ var init_pgSerializer = __esm({
|
|
|
1580
1598
|
--end;
|
|
1581
1599
|
return start > 0 || end < str.length ? str.substring(start, end) : str.toString();
|
|
1582
1600
|
};
|
|
1583
|
-
fromDatabase2 = async (db, tablesFilter = (
|
|
1601
|
+
fromDatabase2 = async (db, tablesFilter = () => true, schemaFilters, progressCallback) => {
|
|
1584
1602
|
const result = {};
|
|
1585
1603
|
const internals = { tables: {} };
|
|
1586
1604
|
const where = schemaFilters.map((t) => `table_schema = '${t}'`).join(" or ");
|
|
@@ -1907,7 +1925,7 @@ var init_pgSerializer = __esm({
|
|
|
1907
1925
|
}
|
|
1908
1926
|
const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
|
|
1909
1927
|
return {
|
|
1910
|
-
version: "
|
|
1928
|
+
version: "6",
|
|
1911
1929
|
dialect: "pg",
|
|
1912
1930
|
tables: result,
|
|
1913
1931
|
enums: enumsToReturn,
|
|
@@ -1979,11 +1997,369 @@ var init_pgSerializer = __esm({
|
|
|
1979
1997
|
}
|
|
1980
1998
|
});
|
|
1981
1999
|
|
|
2000
|
+
// node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js
|
|
2001
|
+
var require_pluralize = __commonJS({
|
|
2002
|
+
"node_modules/.pnpm/pluralize@8.0.0/node_modules/pluralize/pluralize.js"(exports, module) {
|
|
2003
|
+
(function(root, pluralize) {
|
|
2004
|
+
if (typeof __require === "function" && typeof exports === "object" && typeof module === "object") {
|
|
2005
|
+
module.exports = pluralize();
|
|
2006
|
+
} else if (typeof define === "function" && define.amd) {
|
|
2007
|
+
define(function() {
|
|
2008
|
+
return pluralize();
|
|
2009
|
+
});
|
|
2010
|
+
} else {
|
|
2011
|
+
root.pluralize = pluralize();
|
|
2012
|
+
}
|
|
2013
|
+
})(exports, function() {
|
|
2014
|
+
var pluralRules = [];
|
|
2015
|
+
var singularRules = [];
|
|
2016
|
+
var uncountables = {};
|
|
2017
|
+
var irregularPlurals = {};
|
|
2018
|
+
var irregularSingles = {};
|
|
2019
|
+
function sanitizeRule(rule) {
|
|
2020
|
+
if (typeof rule === "string") {
|
|
2021
|
+
return new RegExp("^" + rule + "$", "i");
|
|
2022
|
+
}
|
|
2023
|
+
return rule;
|
|
2024
|
+
}
|
|
2025
|
+
function restoreCase(word, token) {
|
|
2026
|
+
if (word === token)
|
|
2027
|
+
return token;
|
|
2028
|
+
if (word === word.toLowerCase())
|
|
2029
|
+
return token.toLowerCase();
|
|
2030
|
+
if (word === word.toUpperCase())
|
|
2031
|
+
return token.toUpperCase();
|
|
2032
|
+
if (word[0] === word[0].toUpperCase()) {
|
|
2033
|
+
return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
|
|
2034
|
+
}
|
|
2035
|
+
return token.toLowerCase();
|
|
2036
|
+
}
|
|
2037
|
+
function interpolate(str, args) {
|
|
2038
|
+
return str.replace(/\$(\d{1,2})/g, function(match2, index) {
|
|
2039
|
+
return args[index] || "";
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
function replace(word, rule) {
|
|
2043
|
+
return word.replace(rule[0], function(match2, index) {
|
|
2044
|
+
var result = interpolate(rule[1], arguments);
|
|
2045
|
+
if (match2 === "") {
|
|
2046
|
+
return restoreCase(word[index - 1], result);
|
|
2047
|
+
}
|
|
2048
|
+
return restoreCase(match2, result);
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
function sanitizeWord(token, word, rules) {
|
|
2052
|
+
if (!token.length || uncountables.hasOwnProperty(token)) {
|
|
2053
|
+
return word;
|
|
2054
|
+
}
|
|
2055
|
+
var len = rules.length;
|
|
2056
|
+
while (len--) {
|
|
2057
|
+
var rule = rules[len];
|
|
2058
|
+
if (rule[0].test(word))
|
|
2059
|
+
return replace(word, rule);
|
|
2060
|
+
}
|
|
2061
|
+
return word;
|
|
2062
|
+
}
|
|
2063
|
+
function replaceWord(replaceMap, keepMap, rules) {
|
|
2064
|
+
return function(word) {
|
|
2065
|
+
var token = word.toLowerCase();
|
|
2066
|
+
if (keepMap.hasOwnProperty(token)) {
|
|
2067
|
+
return restoreCase(word, token);
|
|
2068
|
+
}
|
|
2069
|
+
if (replaceMap.hasOwnProperty(token)) {
|
|
2070
|
+
return restoreCase(word, replaceMap[token]);
|
|
2071
|
+
}
|
|
2072
|
+
return sanitizeWord(token, word, rules);
|
|
2073
|
+
};
|
|
2074
|
+
}
|
|
2075
|
+
function checkWord(replaceMap, keepMap, rules, bool) {
|
|
2076
|
+
return function(word) {
|
|
2077
|
+
var token = word.toLowerCase();
|
|
2078
|
+
if (keepMap.hasOwnProperty(token))
|
|
2079
|
+
return true;
|
|
2080
|
+
if (replaceMap.hasOwnProperty(token))
|
|
2081
|
+
return false;
|
|
2082
|
+
return sanitizeWord(token, token, rules) === token;
|
|
2083
|
+
};
|
|
2084
|
+
}
|
|
2085
|
+
function pluralize(word, count, inclusive) {
|
|
2086
|
+
var pluralized = count === 1 ? pluralize.singular(word) : pluralize.plural(word);
|
|
2087
|
+
return (inclusive ? count + " " : "") + pluralized;
|
|
2088
|
+
}
|
|
2089
|
+
pluralize.plural = replaceWord(
|
|
2090
|
+
irregularSingles,
|
|
2091
|
+
irregularPlurals,
|
|
2092
|
+
pluralRules
|
|
2093
|
+
);
|
|
2094
|
+
pluralize.isPlural = checkWord(
|
|
2095
|
+
irregularSingles,
|
|
2096
|
+
irregularPlurals,
|
|
2097
|
+
pluralRules
|
|
2098
|
+
);
|
|
2099
|
+
pluralize.singular = replaceWord(
|
|
2100
|
+
irregularPlurals,
|
|
2101
|
+
irregularSingles,
|
|
2102
|
+
singularRules
|
|
2103
|
+
);
|
|
2104
|
+
pluralize.isSingular = checkWord(
|
|
2105
|
+
irregularPlurals,
|
|
2106
|
+
irregularSingles,
|
|
2107
|
+
singularRules
|
|
2108
|
+
);
|
|
2109
|
+
pluralize.addPluralRule = function(rule, replacement) {
|
|
2110
|
+
pluralRules.push([sanitizeRule(rule), replacement]);
|
|
2111
|
+
};
|
|
2112
|
+
pluralize.addSingularRule = function(rule, replacement) {
|
|
2113
|
+
singularRules.push([sanitizeRule(rule), replacement]);
|
|
2114
|
+
};
|
|
2115
|
+
pluralize.addUncountableRule = function(word) {
|
|
2116
|
+
if (typeof word === "string") {
|
|
2117
|
+
uncountables[word.toLowerCase()] = true;
|
|
2118
|
+
return;
|
|
2119
|
+
}
|
|
2120
|
+
pluralize.addPluralRule(word, "$0");
|
|
2121
|
+
pluralize.addSingularRule(word, "$0");
|
|
2122
|
+
};
|
|
2123
|
+
pluralize.addIrregularRule = function(single, plural2) {
|
|
2124
|
+
plural2 = plural2.toLowerCase();
|
|
2125
|
+
single = single.toLowerCase();
|
|
2126
|
+
irregularSingles[single] = plural2;
|
|
2127
|
+
irregularPlurals[plural2] = single;
|
|
2128
|
+
};
|
|
2129
|
+
[
|
|
2130
|
+
// Pronouns.
|
|
2131
|
+
["I", "we"],
|
|
2132
|
+
["me", "us"],
|
|
2133
|
+
["he", "they"],
|
|
2134
|
+
["she", "they"],
|
|
2135
|
+
["them", "them"],
|
|
2136
|
+
["myself", "ourselves"],
|
|
2137
|
+
["yourself", "yourselves"],
|
|
2138
|
+
["itself", "themselves"],
|
|
2139
|
+
["herself", "themselves"],
|
|
2140
|
+
["himself", "themselves"],
|
|
2141
|
+
["themself", "themselves"],
|
|
2142
|
+
["is", "are"],
|
|
2143
|
+
["was", "were"],
|
|
2144
|
+
["has", "have"],
|
|
2145
|
+
["this", "these"],
|
|
2146
|
+
["that", "those"],
|
|
2147
|
+
// Words ending in with a consonant and `o`.
|
|
2148
|
+
["echo", "echoes"],
|
|
2149
|
+
["dingo", "dingoes"],
|
|
2150
|
+
["volcano", "volcanoes"],
|
|
2151
|
+
["tornado", "tornadoes"],
|
|
2152
|
+
["torpedo", "torpedoes"],
|
|
2153
|
+
// Ends with `us`.
|
|
2154
|
+
["genus", "genera"],
|
|
2155
|
+
["viscus", "viscera"],
|
|
2156
|
+
// Ends with `ma`.
|
|
2157
|
+
["stigma", "stigmata"],
|
|
2158
|
+
["stoma", "stomata"],
|
|
2159
|
+
["dogma", "dogmata"],
|
|
2160
|
+
["lemma", "lemmata"],
|
|
2161
|
+
["schema", "schemata"],
|
|
2162
|
+
["anathema", "anathemata"],
|
|
2163
|
+
// Other irregular rules.
|
|
2164
|
+
["ox", "oxen"],
|
|
2165
|
+
["axe", "axes"],
|
|
2166
|
+
["die", "dice"],
|
|
2167
|
+
["yes", "yeses"],
|
|
2168
|
+
["foot", "feet"],
|
|
2169
|
+
["eave", "eaves"],
|
|
2170
|
+
["goose", "geese"],
|
|
2171
|
+
["tooth", "teeth"],
|
|
2172
|
+
["quiz", "quizzes"],
|
|
2173
|
+
["human", "humans"],
|
|
2174
|
+
["proof", "proofs"],
|
|
2175
|
+
["carve", "carves"],
|
|
2176
|
+
["valve", "valves"],
|
|
2177
|
+
["looey", "looies"],
|
|
2178
|
+
["thief", "thieves"],
|
|
2179
|
+
["groove", "grooves"],
|
|
2180
|
+
["pickaxe", "pickaxes"],
|
|
2181
|
+
["passerby", "passersby"]
|
|
2182
|
+
].forEach(function(rule) {
|
|
2183
|
+
return pluralize.addIrregularRule(rule[0], rule[1]);
|
|
2184
|
+
});
|
|
2185
|
+
[
|
|
2186
|
+
[/s?$/i, "s"],
|
|
2187
|
+
[/[^\u0000-\u007F]$/i, "$0"],
|
|
2188
|
+
[/([^aeiou]ese)$/i, "$1"],
|
|
2189
|
+
[/(ax|test)is$/i, "$1es"],
|
|
2190
|
+
[/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"],
|
|
2191
|
+
[/(e[mn]u)s?$/i, "$1s"],
|
|
2192
|
+
[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"],
|
|
2193
|
+
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"],
|
|
2194
|
+
[/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"],
|
|
2195
|
+
[/(seraph|cherub)(?:im)?$/i, "$1im"],
|
|
2196
|
+
[/(her|at|gr)o$/i, "$1oes"],
|
|
2197
|
+
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"],
|
|
2198
|
+
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"],
|
|
2199
|
+
[/sis$/i, "ses"],
|
|
2200
|
+
[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"],
|
|
2201
|
+
[/([^aeiouy]|qu)y$/i, "$1ies"],
|
|
2202
|
+
[/([^ch][ieo][ln])ey$/i, "$1ies"],
|
|
2203
|
+
[/(x|ch|ss|sh|zz)$/i, "$1es"],
|
|
2204
|
+
[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"],
|
|
2205
|
+
[/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"],
|
|
2206
|
+
[/(pe)(?:rson|ople)$/i, "$1ople"],
|
|
2207
|
+
[/(child)(?:ren)?$/i, "$1ren"],
|
|
2208
|
+
[/eaux$/i, "$0"],
|
|
2209
|
+
[/m[ae]n$/i, "men"],
|
|
2210
|
+
["thou", "you"]
|
|
2211
|
+
].forEach(function(rule) {
|
|
2212
|
+
return pluralize.addPluralRule(rule[0], rule[1]);
|
|
2213
|
+
});
|
|
2214
|
+
[
|
|
2215
|
+
[/s$/i, ""],
|
|
2216
|
+
[/(ss)$/i, "$1"],
|
|
2217
|
+
[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"],
|
|
2218
|
+
[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"],
|
|
2219
|
+
[/ies$/i, "y"],
|
|
2220
|
+
[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"],
|
|
2221
|
+
[/\b(mon|smil)ies$/i, "$1ey"],
|
|
2222
|
+
[/\b((?:tit)?m|l)ice$/i, "$1ouse"],
|
|
2223
|
+
[/(seraph|cherub)im$/i, "$1"],
|
|
2224
|
+
[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"],
|
|
2225
|
+
[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"],
|
|
2226
|
+
[/(movie|twelve|abuse|e[mn]u)s$/i, "$1"],
|
|
2227
|
+
[/(test)(?:is|es)$/i, "$1is"],
|
|
2228
|
+
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"],
|
|
2229
|
+
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"],
|
|
2230
|
+
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"],
|
|
2231
|
+
[/(alumn|alg|vertebr)ae$/i, "$1a"],
|
|
2232
|
+
[/(cod|mur|sil|vert|ind)ices$/i, "$1ex"],
|
|
2233
|
+
[/(matr|append)ices$/i, "$1ix"],
|
|
2234
|
+
[/(pe)(rson|ople)$/i, "$1rson"],
|
|
2235
|
+
[/(child)ren$/i, "$1"],
|
|
2236
|
+
[/(eau)x?$/i, "$1"],
|
|
2237
|
+
[/men$/i, "man"]
|
|
2238
|
+
].forEach(function(rule) {
|
|
2239
|
+
return pluralize.addSingularRule(rule[0], rule[1]);
|
|
2240
|
+
});
|
|
2241
|
+
[
|
|
2242
|
+
// Singular words with no plurals.
|
|
2243
|
+
"adulthood",
|
|
2244
|
+
"advice",
|
|
2245
|
+
"agenda",
|
|
2246
|
+
"aid",
|
|
2247
|
+
"aircraft",
|
|
2248
|
+
"alcohol",
|
|
2249
|
+
"ammo",
|
|
2250
|
+
"analytics",
|
|
2251
|
+
"anime",
|
|
2252
|
+
"athletics",
|
|
2253
|
+
"audio",
|
|
2254
|
+
"bison",
|
|
2255
|
+
"blood",
|
|
2256
|
+
"bream",
|
|
2257
|
+
"buffalo",
|
|
2258
|
+
"butter",
|
|
2259
|
+
"carp",
|
|
2260
|
+
"cash",
|
|
2261
|
+
"chassis",
|
|
2262
|
+
"chess",
|
|
2263
|
+
"clothing",
|
|
2264
|
+
"cod",
|
|
2265
|
+
"commerce",
|
|
2266
|
+
"cooperation",
|
|
2267
|
+
"corps",
|
|
2268
|
+
"debris",
|
|
2269
|
+
"diabetes",
|
|
2270
|
+
"digestion",
|
|
2271
|
+
"elk",
|
|
2272
|
+
"energy",
|
|
2273
|
+
"equipment",
|
|
2274
|
+
"excretion",
|
|
2275
|
+
"expertise",
|
|
2276
|
+
"firmware",
|
|
2277
|
+
"flounder",
|
|
2278
|
+
"fun",
|
|
2279
|
+
"gallows",
|
|
2280
|
+
"garbage",
|
|
2281
|
+
"graffiti",
|
|
2282
|
+
"hardware",
|
|
2283
|
+
"headquarters",
|
|
2284
|
+
"health",
|
|
2285
|
+
"herpes",
|
|
2286
|
+
"highjinks",
|
|
2287
|
+
"homework",
|
|
2288
|
+
"housework",
|
|
2289
|
+
"information",
|
|
2290
|
+
"jeans",
|
|
2291
|
+
"justice",
|
|
2292
|
+
"kudos",
|
|
2293
|
+
"labour",
|
|
2294
|
+
"literature",
|
|
2295
|
+
"machinery",
|
|
2296
|
+
"mackerel",
|
|
2297
|
+
"mail",
|
|
2298
|
+
"media",
|
|
2299
|
+
"mews",
|
|
2300
|
+
"moose",
|
|
2301
|
+
"music",
|
|
2302
|
+
"mud",
|
|
2303
|
+
"manga",
|
|
2304
|
+
"news",
|
|
2305
|
+
"only",
|
|
2306
|
+
"personnel",
|
|
2307
|
+
"pike",
|
|
2308
|
+
"plankton",
|
|
2309
|
+
"pliers",
|
|
2310
|
+
"police",
|
|
2311
|
+
"pollution",
|
|
2312
|
+
"premises",
|
|
2313
|
+
"rain",
|
|
2314
|
+
"research",
|
|
2315
|
+
"rice",
|
|
2316
|
+
"salmon",
|
|
2317
|
+
"scissors",
|
|
2318
|
+
"series",
|
|
2319
|
+
"sewage",
|
|
2320
|
+
"shambles",
|
|
2321
|
+
"shrimp",
|
|
2322
|
+
"software",
|
|
2323
|
+
"species",
|
|
2324
|
+
"staff",
|
|
2325
|
+
"swine",
|
|
2326
|
+
"tennis",
|
|
2327
|
+
"traffic",
|
|
2328
|
+
"transportation",
|
|
2329
|
+
"trout",
|
|
2330
|
+
"tuna",
|
|
2331
|
+
"wealth",
|
|
2332
|
+
"welfare",
|
|
2333
|
+
"whiting",
|
|
2334
|
+
"wildebeest",
|
|
2335
|
+
"wildlife",
|
|
2336
|
+
"you",
|
|
2337
|
+
/pok[eé]mon$/i,
|
|
2338
|
+
// Regexes.
|
|
2339
|
+
/[^aeiou]ese$/i,
|
|
2340
|
+
// "chinese", "japanese"
|
|
2341
|
+
/deer$/i,
|
|
2342
|
+
// "deer", "reindeer"
|
|
2343
|
+
/fish$/i,
|
|
2344
|
+
// "fish", "blowfish", "angelfish"
|
|
2345
|
+
/measles$/i,
|
|
2346
|
+
/o[iu]s$/i,
|
|
2347
|
+
// "carnivorous"
|
|
2348
|
+
/pox$/i,
|
|
2349
|
+
// "chickpox", "smallpox"
|
|
2350
|
+
/sheep$/i
|
|
2351
|
+
].forEach(pluralize.addUncountableRule);
|
|
2352
|
+
return pluralize;
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2355
|
+
});
|
|
2356
|
+
|
|
1982
2357
|
// src/drivers/index.ts
|
|
1983
2358
|
import { sql } from "drizzle-orm";
|
|
1984
2359
|
var DrizzleDbClient, DrizzleORMPgClient, TursoSqlite;
|
|
1985
2360
|
var init_drivers = __esm({
|
|
1986
2361
|
"src/drivers/index.ts"() {
|
|
2362
|
+
"use strict";
|
|
1987
2363
|
DrizzleDbClient = class {
|
|
1988
2364
|
constructor(db) {
|
|
1989
2365
|
this.db = db;
|
|
@@ -2200,11 +2576,7 @@ var sqliteSchemaToDrizzle = (schema) => {
|
|
|
2200
2576
|
|
|
2201
2577
|
// src/cli/commands/sqliteIntrospect.ts
|
|
2202
2578
|
init_views();
|
|
2203
|
-
|
|
2204
|
-
// src/global.ts
|
|
2205
|
-
var originUUID = "00000000-0000-0000-0000-000000000000";
|
|
2206
|
-
|
|
2207
|
-
// src/cli/commands/sqliteIntrospect.ts
|
|
2579
|
+
init_global();
|
|
2208
2580
|
init_sqliteSerializer();
|
|
2209
2581
|
|
|
2210
2582
|
// node_modules/.pnpm/camelcase@7.0.1/node_modules/camelcase/index.js
|
|
@@ -2306,7 +2678,7 @@ String.prototype.camelCase = function() {
|
|
|
2306
2678
|
return camelCase(String(this));
|
|
2307
2679
|
};
|
|
2308
2680
|
String.prototype.concatIf = function(it, condition) {
|
|
2309
|
-
return condition ? `${this}${it}` : this;
|
|
2681
|
+
return condition ? `${this}${it}` : String(this);
|
|
2310
2682
|
};
|
|
2311
2683
|
Array.prototype.random = function() {
|
|
2312
2684
|
return this[~~(Math.random() * this.length)];
|
|
@@ -3385,6 +3757,7 @@ init_views();
|
|
|
3385
3757
|
init_pgSerializer();
|
|
3386
3758
|
|
|
3387
3759
|
// src/introspect-pg.ts
|
|
3760
|
+
var import_pluralize = __toESM(require_pluralize());
|
|
3388
3761
|
import { getTableName as getTableName3, is as is3 } from "drizzle-orm";
|
|
3389
3762
|
import {
|
|
3390
3763
|
createTableRelationsHelpers,
|
|
@@ -3395,6 +3768,7 @@ import {
|
|
|
3395
3768
|
init_pgSerializer();
|
|
3396
3769
|
|
|
3397
3770
|
// src/cli/commands/pgIntrospect.ts
|
|
3771
|
+
init_global();
|
|
3398
3772
|
var pgPushIntrospect = async (connection, filters, schemaFilters) => {
|
|
3399
3773
|
const { client } = connection;
|
|
3400
3774
|
const matchers = filters.map((it) => {
|
package/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Dialect } from "./schemaValidator";
|
|
2
2
|
import { NamedWithSchema } from "./cli/commands/migrate";
|
|
3
|
-
export declare const assertV1OutFolder: (out: string
|
|
3
|
+
export declare const assertV1OutFolder: (out: string) => void;
|
|
4
4
|
export type Journal = {
|
|
5
5
|
version: string;
|
|
6
6
|
dialect: Dialect;
|
|
@@ -50,9 +50,9 @@ export declare const prepareMigrationMeta: (schemas: {
|
|
|
50
50
|
column: string;
|
|
51
51
|
};
|
|
52
52
|
}[]) => {
|
|
53
|
-
schemas:
|
|
54
|
-
tables:
|
|
55
|
-
columns:
|
|
53
|
+
schemas: Record<string, string>;
|
|
54
|
+
tables: Record<string, string>;
|
|
55
|
+
columns: Record<string, string>;
|
|
56
56
|
};
|
|
57
57
|
export declare const schemaRenameKey: (it: string) => string;
|
|
58
58
|
export declare const tableRenameKey: (it: NamedWithSchema) => string;
|
|
@@ -73,10 +73,6 @@ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
|
|
|
73
73
|
} | undefined>;
|
|
74
74
|
} | undefined>;
|
|
75
75
|
} | undefined;
|
|
76
|
-
id: string;
|
|
77
|
-
prevId: string;
|
|
78
|
-
version: "5";
|
|
79
|
-
dialect: "pg";
|
|
80
76
|
tables: Record<string, {
|
|
81
77
|
name: string;
|
|
82
78
|
columns: Record<string, {
|
|
@@ -115,6 +111,10 @@ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
|
|
|
115
111
|
nullsNotDistinct: boolean;
|
|
116
112
|
}>;
|
|
117
113
|
}>;
|
|
114
|
+
id: string;
|
|
115
|
+
prevId: string;
|
|
116
|
+
version: "6";
|
|
117
|
+
dialect: "pg";
|
|
118
118
|
schemas: Record<string, string>;
|
|
119
119
|
_meta: {
|
|
120
120
|
columns: Record<string, string>;
|
|
@@ -136,10 +136,6 @@ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
|
|
|
136
136
|
} | undefined>;
|
|
137
137
|
} | undefined>;
|
|
138
138
|
} | undefined;
|
|
139
|
-
id: string;
|
|
140
|
-
prevId: string;
|
|
141
|
-
version: "5";
|
|
142
|
-
dialect: "pg";
|
|
143
139
|
tables: Record<string, {
|
|
144
140
|
name: string;
|
|
145
141
|
columns: Record<string, {
|
|
@@ -178,6 +174,10 @@ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
|
|
|
178
174
|
nullsNotDistinct: boolean;
|
|
179
175
|
}>;
|
|
180
176
|
}>;
|
|
177
|
+
id: string;
|
|
178
|
+
prevId: string;
|
|
179
|
+
version: "6";
|
|
180
|
+
dialect: "pg";
|
|
181
181
|
schemas: Record<string, string>;
|
|
182
182
|
_meta: {
|
|
183
183
|
columns: Record<string, string>;
|