drizzle-kit 0.24.2-30e7661 → 0.24.2-50ebd0a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. package/api.js +661 -583
  2. package/api.mjs +661 -583
  3. package/bin.cjs +34 -4
  4. package/package.json +1 -1
package/bin.cjs CHANGED
@@ -19143,11 +19143,12 @@ ${withStyle.errorWarning(
19143
19143
  }
19144
19144
  columnTypeMapped = columnTypeMapped.replace("character varying", "varchar").replace(" without time zone", "").replace("character", "char");
19145
19145
  columnTypeMapped = trimChar(columnTypeMapped, '"');
19146
+ columnTypeMapped = columnTypeMapped.replace("geography(Point,4326)", "geography(point)");
19146
19147
  columnToReturn[columnName] = {
19147
19148
  name: columnName,
19148
19149
  type: (
19149
19150
  // filter vectors, but in future we should filter any extension that was installed by user
19150
- columnAdditionalDT === "USER-DEFINED" && !["vector", "geometry"].includes(enumType2) ? enumType2 : columnTypeMapped
19151
+ columnAdditionalDT === "USER-DEFINED" && !["vector", "geometry", "geography"].includes(enumType2) ? enumType2 : columnTypeMapped
19151
19152
  ),
19152
19153
  typeSchema: enumsToReturn[`${typeSchema}.${enumType2}`] !== void 0 ? enumsToReturn[`${typeSchema}.${enumType2}`].schema : void 0,
19153
19154
  primaryKey: primaryKey.length === 1 && cprimaryKey.length < 2,
@@ -22972,7 +22973,7 @@ var init_sqlgenerator = __esm({
22972
22973
  if (pgNativeTypes.has(it))
22973
22974
  return true;
22974
22975
  const toCheck = it.replace(/ /g, "");
22975
- return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(") || toCheck.startsWith("doubleprecision[") || toCheck.startsWith("intervalyear(") || toCheck.startsWith("intervalmonth(") || toCheck.startsWith("intervalday(") || toCheck.startsWith("intervalhour(") || toCheck.startsWith("intervalminute(") || toCheck.startsWith("intervalsecond(") || toCheck.startsWith("intervalyeartomonth(") || toCheck.startsWith("intervaldaytohour(") || toCheck.startsWith("intervaldaytominute(") || toCheck.startsWith("intervaldaytosecond(") || toCheck.startsWith("intervalhourtominute(") || toCheck.startsWith("intervalhourtosecond(") || toCheck.startsWith("intervalminutetosecond(") || toCheck.startsWith("vector(") || toCheck.startsWith("geometry(") || /^(\w+)(\[\d*])+$/.test(it);
22976
+ return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(") || toCheck.startsWith("doubleprecision[") || toCheck.startsWith("intervalyear(") || toCheck.startsWith("intervalmonth(") || toCheck.startsWith("intervalday(") || toCheck.startsWith("intervalhour(") || toCheck.startsWith("intervalminute(") || toCheck.startsWith("intervalsecond(") || toCheck.startsWith("intervalyeartomonth(") || toCheck.startsWith("intervaldaytohour(") || toCheck.startsWith("intervaldaytominute(") || toCheck.startsWith("intervaldaytosecond(") || toCheck.startsWith("intervalhourtominute(") || toCheck.startsWith("intervalhourtosecond(") || toCheck.startsWith("intervalminutetosecond(") || toCheck.startsWith("vector(") || toCheck.startsWith("geometry(") || toCheck.startsWith("geography(") || /^(\w+)(\[\d*])+$/.test(it);
22976
22977
  };
22977
22978
  Convertor = class {
22978
22979
  };
@@ -75913,7 +75914,8 @@ var init_introspect_pg = __esm({
75913
75914
  "vector",
75914
75915
  "point",
75915
75916
  "line",
75916
- "geometry"
75917
+ "geometry",
75918
+ "geography"
75917
75919
  ]);
75918
75920
  timeConfig2 = (json) => {
75919
75921
  json = Object.fromEntries(Object.entries(json).filter((it) => it[1]));
@@ -76056,6 +76058,7 @@ var init_introspect_pg = __esm({
76056
76058
  patched = patched.startsWith("timestamp(") ? "timestamp" : patched;
76057
76059
  patched = patched.startsWith("vector(") ? "vector" : patched;
76058
76060
  patched = patched.startsWith("geometry(") ? "geometry" : patched;
76061
+ patched = patched.startsWith("geography(") ? "geography" : patched;
76059
76062
  return patched;
76060
76063
  }).filter((type) => {
76061
76064
  return pgImportsList.has(type);
@@ -76282,6 +76285,9 @@ var init_introspect_pg = __esm({
76282
76285
  if (lowered.startsWith("geometry")) {
76283
76286
  return typeof defaultValue !== "undefined" ? `.default(${mapColumnDefault3(defaultValue, isExpression)})` : "";
76284
76287
  }
76288
+ if (lowered.startsWith("geography")) {
76289
+ return typeof defaultValue !== "undefined" ? `.default(${mapColumnDefault3(defaultValue, isExpression)})` : "";
76290
+ }
76285
76291
  if (lowered.startsWith("vector")) {
76286
76292
  return typeof defaultValue !== "undefined" ? `.default(${mapColumnDefault3(defaultValue, isExpression)})` : "";
76287
76293
  }
@@ -76454,6 +76460,30 @@ var init_introspect_pg = __esm({
76454
76460
  if (isGeoUnknown) {
76455
76461
  let unknown2 = `// TODO: failed to parse geometry type because found more than 2 options inside geometry function '${type}'
76456
76462
  // Introspect is currently supporting only type and srid options
76463
+ `;
76464
+ unknown2 += ` ${withCasing2(name, casing2)}: unknown("${name}")`;
76465
+ return unknown2;
76466
+ }
76467
+ return out;
76468
+ }
76469
+ if (lowered.startsWith("geography")) {
76470
+ let out = "";
76471
+ let isGeoUnknown = false;
76472
+ if (lowered.length !== 9) {
76473
+ const geographyOptions = lowered.slice(10, -1).split(",");
76474
+ if (geographyOptions.length === 1 && geographyOptions[0] !== "") {
76475
+ out = `${withCasing2(name, casing2)}: geography("${name}", { type: "${geographyOptions[0]}" })`;
76476
+ } else if (geographyOptions.length === 2) {
76477
+ out = `${withCasing2(name, casing2)}: geography("${name}", { type: "${geographyOptions[0]}", srid: ${geographyOptions[1]} })`;
76478
+ } else {
76479
+ isGeoUnknown = true;
76480
+ }
76481
+ } else {
76482
+ out = `${withCasing2(name, casing2)}: geography("${name}")`;
76483
+ }
76484
+ if (isGeoUnknown) {
76485
+ let unknown2 = `// TODO: failed to parse geography type because found more than 2 options inside geography function '${type}'
76486
+ // Introspect is currently supporting only type and srid options
76457
76487
  `;
76458
76488
  unknown2 += ` ${withCasing2(name, casing2)}: unknown("${name}")`;
76459
76489
  return unknown2;
@@ -84028,7 +84058,7 @@ init_utils2();
84028
84058
  var version2 = async () => {
84029
84059
  const { npmVersion } = await ormCoreVersions();
84030
84060
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
84031
- const envVersion = "0.24.2-30e7661";
84061
+ const envVersion = "0.24.2-50ebd0a";
84032
84062
  const kitVersion = envVersion ? `v${envVersion}` : "--";
84033
84063
  const versions = `drizzle-kit: ${kitVersion}
84034
84064
  ${ormVersion}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.24.2-30e7661",
3
+ "version": "0.24.2-50ebd0a",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",