drizzle-kit 0.26.2-1b1151d → 0.26.2-57d2372

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 +772 -515
  2. package/api.mjs +772 -515
  3. package/bin.cjs +57 -3
  4. package/package.json +1 -1
package/bin.cjs CHANGED
@@ -24209,7 +24209,7 @@ var init_sqlgenerator = __esm({
24209
24209
  if (pgNativeTypes.has(it))
24210
24210
  return true;
24211
24211
  const toCheck = it.replace(/ /g, "");
24212
- 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);
24212
+ 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);
24213
24213
  };
24214
24214
  Convertor = class {
24215
24215
  };
@@ -83047,7 +83047,13 @@ var init_introspect_pg = __esm({
83047
83047
  "vector",
83048
83048
  "point",
83049
83049
  "line",
83050
- "geometry"
83050
+ "geometry",
83051
+ "geography",
83052
+ "oid",
83053
+ "name",
83054
+ "compactstateagg",
83055
+ "stateagg",
83056
+ "heartbeatagg"
83051
83057
  ]);
83052
83058
  timeConfig2 = (json) => {
83053
83059
  json = Object.fromEntries(Object.entries(json).filter((it) => it[1]));
@@ -83196,6 +83202,7 @@ var init_introspect_pg = __esm({
83196
83202
  patched = patched.startsWith("timestamp(") ? "timestamp" : patched;
83197
83203
  patched = patched.startsWith("vector(") ? "vector" : patched;
83198
83204
  patched = patched.startsWith("geometry(") ? "geometry" : patched;
83205
+ patched = patched.startsWith("geography(") ? "geography" : patched;
83199
83206
  return patched;
83200
83207
  }).filter((type) => {
83201
83208
  return pgImportsList.has(type);
@@ -83468,6 +83475,9 @@ var init_introspect_pg = __esm({
83468
83475
  if (lowered.startsWith("geometry")) {
83469
83476
  return typeof defaultValue !== "undefined" ? `.default(${mapColumnDefault3(defaultValue, isExpression)})` : "";
83470
83477
  }
83478
+ if (lowered.startsWith("geography")) {
83479
+ return typeof defaultValue !== "undefined" ? `.default(${mapColumnDefault3(defaultValue, isExpression)})` : "";
83480
+ }
83471
83481
  if (lowered.startsWith("vector")) {
83472
83482
  return typeof defaultValue !== "undefined" ? `.default(${mapColumnDefault3(defaultValue, isExpression)})` : "";
83473
83483
  }
@@ -83624,6 +83634,30 @@ var init_introspect_pg = __esm({
83624
83634
  if (isGeoUnknown) {
83625
83635
  let unknown2 = `// TODO: failed to parse geometry type because found more than 2 options inside geometry function '${type}'
83626
83636
  // Introspect is currently supporting only type and srid options
83637
+ `;
83638
+ unknown2 += ` ${withCasing2(name, casing2)}: unknown("${name}")`;
83639
+ return unknown2;
83640
+ }
83641
+ return out;
83642
+ }
83643
+ if (lowered.startsWith("geography")) {
83644
+ let out = "";
83645
+ let isGeoUnknown = false;
83646
+ if (lowered.length !== 9) {
83647
+ const geographyOptions = lowered.slice(10, -1).split(",");
83648
+ if (geographyOptions.length === 1 && geographyOptions[0] !== "") {
83649
+ out = `${withCasing2(name, casing2)}: geography("${name}", { type: "${geographyOptions[0]}" })`;
83650
+ } else if (geographyOptions.length === 2) {
83651
+ out = `${withCasing2(name, casing2)}: geography("${name}", { type: "${geographyOptions[0]}", srid: ${geographyOptions[1]} })`;
83652
+ } else {
83653
+ isGeoUnknown = true;
83654
+ }
83655
+ } else {
83656
+ out = `${withCasing2(name, casing2)}: geography("${name}")`;
83657
+ }
83658
+ if (isGeoUnknown) {
83659
+ let unknown2 = `// TODO: failed to parse geography type because found more than 2 options inside geography function '${type}'
83660
+ // Introspect is currently supporting only type and srid options
83627
83661
  `;
83628
83662
  unknown2 += ` ${withCasing2(name, casing2)}: unknown("${name}")`;
83629
83663
  return unknown2;
@@ -83648,6 +83682,26 @@ var init_introspect_pg = __esm({
83648
83682
  }
83649
83683
  return out;
83650
83684
  }
83685
+ if (lowered === "oid") {
83686
+ let out = `${withCasing2(name, casing2)}: oid(${dbColumnName3({ name, casing: casing2 })})`;
83687
+ return out;
83688
+ }
83689
+ if (lowered === "name") {
83690
+ let out = `${withCasing2(name, casing2)}: name(${dbColumnName3({ name, casing: casing2 })})`;
83691
+ return out;
83692
+ }
83693
+ if (lowered === "heartbeatagg") {
83694
+ let out = `${withCasing2(name, casing2)}: heartbeatagg(${dbColumnName3({ name, casing: casing2 })})`;
83695
+ return out;
83696
+ }
83697
+ if (lowered === "stateagg") {
83698
+ let out = `${withCasing2(name, casing2)}: stateagg(${dbColumnName3({ name, casing: casing2 })})`;
83699
+ return out;
83700
+ }
83701
+ if (lowered === "compactstateagg") {
83702
+ let out = `${withCasing2(name, casing2)}: compactstateagg(${dbColumnName3({ name, casing: casing2 })})`;
83703
+ return out;
83704
+ }
83651
83705
  let unknown = `// TODO: failed to parse database type '${type}'
83652
83706
  `;
83653
83707
  unknown += ` ${withCasing2(name, casing2)}: unknown("${name}")`;
@@ -87624,7 +87678,7 @@ init_utils2();
87624
87678
  var version2 = async () => {
87625
87679
  const { npmVersion } = await ormCoreVersions();
87626
87680
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
87627
- const envVersion = "0.26.2-1b1151d";
87681
+ const envVersion = "0.26.2-57d2372";
87628
87682
  const kitVersion = envVersion ? `v${envVersion}` : "--";
87629
87683
  const versions = `drizzle-kit: ${kitVersion}
87630
87684
  ${ormVersion}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.26.2-1b1151d",
3
+ "version": "0.26.2-57d2372",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",