drizzle-kit 0.23.2 → 0.24.0-38d6dab

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. package/api.d.mts +20 -4
  2. package/api.d.ts +20 -4
  3. package/api.js +1315 -404
  4. package/api.mjs +1315 -404
  5. package/bin.cjs +1658 -394
  6. package/package.json +1 -1
  7. package/utils.js +14 -0
  8. package/utils.mjs +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.23.2",
3
+ "version": "0.24.0-38d6dab",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
package/utils.js CHANGED
@@ -568,6 +568,8 @@ __export(utils_exports, {
568
568
  columnRenameKey: () => columnRenameKey,
569
569
  copy: () => copy,
570
570
  dryJournal: () => dryJournal,
571
+ findAddedAndRemoved: () => findAddedAndRemoved,
572
+ isPgArrayType: () => isPgArrayType,
571
573
  kloudMeta: () => kloudMeta,
572
574
  normaliseSQLiteUrl: () => normaliseSQLiteUrl,
573
575
  objectValues: () => objectValues,
@@ -5738,12 +5740,24 @@ var normaliseSQLiteUrl = (it, type) => {
5738
5740
  }
5739
5741
  assertUnreachable(type);
5740
5742
  };
5743
+ function isPgArrayType(sqlType) {
5744
+ return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
5745
+ }
5746
+ function findAddedAndRemoved(columnNames1, columnNames2) {
5747
+ const set1 = new Set(columnNames1);
5748
+ const set2 = new Set(columnNames2);
5749
+ const addedColumns = columnNames2.filter((it) => !set1.has(it));
5750
+ const removedColumns = columnNames1.filter((it) => !set2.has(it));
5751
+ return { addedColumns, removedColumns };
5752
+ }
5741
5753
  // Annotate the CommonJS export names for ESM import in node:
5742
5754
  0 && (module.exports = {
5743
5755
  assertV1OutFolder,
5744
5756
  columnRenameKey,
5745
5757
  copy,
5746
5758
  dryJournal,
5759
+ findAddedAndRemoved,
5760
+ isPgArrayType,
5747
5761
  kloudMeta,
5748
5762
  normaliseSQLiteUrl,
5749
5763
  objectValues,
package/utils.mjs CHANGED
@@ -5720,11 +5720,23 @@ var normaliseSQLiteUrl = (it, type) => {
5720
5720
  }
5721
5721
  assertUnreachable(type);
5722
5722
  };
5723
+ function isPgArrayType(sqlType) {
5724
+ return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
5725
+ }
5726
+ function findAddedAndRemoved(columnNames1, columnNames2) {
5727
+ const set1 = new Set(columnNames1);
5728
+ const set2 = new Set(columnNames2);
5729
+ const addedColumns = columnNames2.filter((it) => !set1.has(it));
5730
+ const removedColumns = columnNames1.filter((it) => !set2.has(it));
5731
+ return { addedColumns, removedColumns };
5732
+ }
5723
5733
  export {
5724
5734
  assertV1OutFolder,
5725
5735
  columnRenameKey,
5726
5736
  copy,
5727
5737
  dryJournal,
5738
+ findAddedAndRemoved,
5739
+ isPgArrayType,
5728
5740
  kloudMeta,
5729
5741
  normaliseSQLiteUrl,
5730
5742
  objectValues,