drizzle-kit 0.24.2-1a5913a → 0.24.2-2bc0d1e

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.js +87978 -13525
  2. package/api.mjs +87975 -13525
  3. package/bin.cjs +48472 -47285
  4. package/index.d.mts +3 -4
  5. package/index.d.ts +3 -4
  6. package/package.json +3 -2
  7. package/utils.js +11 -0
  8. package/utils.mjs +10 -0
package/index.d.mts CHANGED
@@ -2,10 +2,10 @@ import { ConnectionOptions } from 'tls';
2
2
 
3
3
  declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
4
  type Prefix = (typeof prefixes)[number];
5
- declare const drivers: readonly ["turso", "d1-http", "expo", "aws-data-api", "pglite"];
5
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
6
  type Driver = (typeof drivers)[number];
7
7
 
8
- declare const dialects: readonly ["postgresql", "mysql", "sqlite"];
8
+ declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso"];
9
9
  type Dialect = (typeof dialects)[number];
10
10
 
11
11
  type SslOptions = {
@@ -128,8 +128,7 @@ type Config = {
128
128
  casing: 'camel' | 'preserve';
129
129
  };
130
130
  } & ({
131
- dialect: Verify<Dialect, 'sqlite'>;
132
- driver: Verify<Driver, 'turso'>;
131
+ dialect: Verify<Dialect, 'turso'>;
133
132
  dbCredentials: {
134
133
  url: string;
135
134
  authToken?: string;
package/index.d.ts CHANGED
@@ -2,10 +2,10 @@ import { ConnectionOptions } from 'tls';
2
2
 
3
3
  declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
4
  type Prefix = (typeof prefixes)[number];
5
- declare const drivers: readonly ["turso", "d1-http", "expo", "aws-data-api", "pglite"];
5
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
6
  type Driver = (typeof drivers)[number];
7
7
 
8
- declare const dialects: readonly ["postgresql", "mysql", "sqlite"];
8
+ declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso"];
9
9
  type Dialect = (typeof dialects)[number];
10
10
 
11
11
  type SslOptions = {
@@ -128,8 +128,7 @@ type Config = {
128
128
  casing: 'camel' | 'preserve';
129
129
  };
130
130
  } & ({
131
- dialect: Verify<Dialect, 'sqlite'>;
132
- driver: Verify<Driver, 'turso'>;
131
+ dialect: Verify<Dialect, 'turso'>;
133
132
  dbCredentials: {
134
133
  url: string;
135
134
  authToken?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.24.2-1a5913a",
3
+ "version": "0.24.2-2bc0d1e",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -54,7 +54,7 @@
54
54
  "@electric-sql/pglite": "^0.1.5",
55
55
  "@hono/node-server": "^1.9.0",
56
56
  "@hono/zod-validator": "^0.2.1",
57
- "@libsql/client": "^0.4.2",
57
+ "@libsql/client": "^0.10.0",
58
58
  "@neondatabase/serverless": "^0.9.1",
59
59
  "@originjs/vite-plugin-commonjs": "^1.0.3",
60
60
  "@planetscale/database": "^1.16.0",
@@ -74,6 +74,7 @@
74
74
  "@vercel/postgres": "^0.8.0",
75
75
  "ava": "^5.1.0",
76
76
  "better-sqlite3": "^9.4.3",
77
+ "bun-types": "^0.6.6",
77
78
  "camelcase": "^7.0.1",
78
79
  "chalk": "^5.2.0",
79
80
  "commander": "^12.1.0",
package/utils.js CHANGED
@@ -568,6 +568,7 @@ __export(utils_exports, {
568
568
  columnRenameKey: () => columnRenameKey,
569
569
  copy: () => copy,
570
570
  dryJournal: () => dryJournal,
571
+ findAddedAndRemoved: () => findAddedAndRemoved,
571
572
  isPgArrayType: () => isPgArrayType,
572
573
  kloudMeta: () => kloudMeta,
573
574
  normalisePGliteUrl: () => normalisePGliteUrl,
@@ -5596,6 +5597,8 @@ var validatorForDialect = (dialect3) => {
5596
5597
  return { validator: backwardCompatiblePgSchema, version: 7 };
5597
5598
  case "sqlite":
5598
5599
  return { validator: backwardCompatibleSqliteSchema, version: 6 };
5600
+ case "turso":
5601
+ return { validator: backwardCompatibleSqliteSchema, version: 6 };
5599
5602
  case "mysql":
5600
5603
  return { validator: backwardCompatibleMysqlSchema, version: 5 };
5601
5604
  }
@@ -5750,12 +5753,20 @@ var normalisePGliteUrl = (it) => {
5750
5753
  function isPgArrayType(sqlType) {
5751
5754
  return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
5752
5755
  }
5756
+ function findAddedAndRemoved(columnNames1, columnNames2) {
5757
+ const set1 = new Set(columnNames1);
5758
+ const set2 = new Set(columnNames2);
5759
+ const addedColumns = columnNames2.filter((it) => !set1.has(it));
5760
+ const removedColumns = columnNames1.filter((it) => !set2.has(it));
5761
+ return { addedColumns, removedColumns };
5762
+ }
5753
5763
  // Annotate the CommonJS export names for ESM import in node:
5754
5764
  0 && (module.exports = {
5755
5765
  assertV1OutFolder,
5756
5766
  columnRenameKey,
5757
5767
  copy,
5758
5768
  dryJournal,
5769
+ findAddedAndRemoved,
5759
5770
  isPgArrayType,
5760
5771
  kloudMeta,
5761
5772
  normalisePGliteUrl,
package/utils.mjs CHANGED
@@ -5576,6 +5576,8 @@ var validatorForDialect = (dialect3) => {
5576
5576
  return { validator: backwardCompatiblePgSchema, version: 7 };
5577
5577
  case "sqlite":
5578
5578
  return { validator: backwardCompatibleSqliteSchema, version: 6 };
5579
+ case "turso":
5580
+ return { validator: backwardCompatibleSqliteSchema, version: 6 };
5579
5581
  case "mysql":
5580
5582
  return { validator: backwardCompatibleMysqlSchema, version: 5 };
5581
5583
  }
@@ -5730,11 +5732,19 @@ var normalisePGliteUrl = (it) => {
5730
5732
  function isPgArrayType(sqlType) {
5731
5733
  return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
5732
5734
  }
5735
+ function findAddedAndRemoved(columnNames1, columnNames2) {
5736
+ const set1 = new Set(columnNames1);
5737
+ const set2 = new Set(columnNames2);
5738
+ const addedColumns = columnNames2.filter((it) => !set1.has(it));
5739
+ const removedColumns = columnNames1.filter((it) => !set2.has(it));
5740
+ return { addedColumns, removedColumns };
5741
+ }
5733
5742
  export {
5734
5743
  assertV1OutFolder,
5735
5744
  columnRenameKey,
5736
5745
  copy,
5737
5746
  dryJournal,
5747
+ findAddedAndRemoved,
5738
5748
  isPgArrayType,
5739
5749
  kloudMeta,
5740
5750
  normalisePGliteUrl,