drizzle-kit 0.24.1-781dea0 → 0.24.1-edf2ac4

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/index.d.mts CHANGED
@@ -2,7 +2,7 @@ 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"];
5
+ declare const drivers: readonly ["turso", "d1-http", "expo", "aws-data-api", "pglite"];
6
6
  type Driver = (typeof drivers)[number];
7
7
 
8
8
  declare const dialects: readonly ["postgresql", "mysql", "sqlite"];
@@ -43,7 +43,7 @@ type Verify<T, U extends T> = U;
43
43
  *
44
44
  * ---
45
45
  * `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
46
- * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
46
+ * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`, `pglite`
47
47
  * If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
48
48
  *
49
49
  * See https://orm.drizzle.team/kit-docs/config-reference#driver
@@ -135,7 +135,7 @@ type Config = {
135
135
  authToken?: string;
136
136
  };
137
137
  } | {
138
- dialect: 'sqlite';
138
+ dialect: Verify<Dialect, 'sqlite'>;
139
139
  dbCredentials: {
140
140
  url: string;
141
141
  };
@@ -159,6 +159,12 @@ type Config = {
159
159
  secretArn: string;
160
160
  resourceArn: string;
161
161
  };
162
+ } | {
163
+ dialect: Verify<Dialect, 'postgresql'>;
164
+ driver: Verify<Driver, 'pglite'>;
165
+ dbCredentials: {
166
+ url: string;
167
+ };
162
168
  } | {
163
169
  dialect: Verify<Dialect, 'mysql'>;
164
170
  dbCredentials: {
@@ -207,7 +213,7 @@ type Config = {
207
213
  *
208
214
  * ---
209
215
  * `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
210
- * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
216
+ * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`, `pglite`
211
217
  * If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
212
218
  *
213
219
  * See https://orm.drizzle.team/kit-docs/config-reference#driver
package/index.d.ts CHANGED
@@ -2,7 +2,7 @@ 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"];
5
+ declare const drivers: readonly ["turso", "d1-http", "expo", "aws-data-api", "pglite"];
6
6
  type Driver = (typeof drivers)[number];
7
7
 
8
8
  declare const dialects: readonly ["postgresql", "mysql", "sqlite"];
@@ -43,7 +43,7 @@ type Verify<T, U extends T> = U;
43
43
  *
44
44
  * ---
45
45
  * `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
46
- * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
46
+ * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`, `pglite`
47
47
  * If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
48
48
  *
49
49
  * See https://orm.drizzle.team/kit-docs/config-reference#driver
@@ -135,7 +135,7 @@ type Config = {
135
135
  authToken?: string;
136
136
  };
137
137
  } | {
138
- dialect: 'sqlite';
138
+ dialect: Verify<Dialect, 'sqlite'>;
139
139
  dbCredentials: {
140
140
  url: string;
141
141
  };
@@ -159,6 +159,12 @@ type Config = {
159
159
  secretArn: string;
160
160
  resourceArn: string;
161
161
  };
162
+ } | {
163
+ dialect: Verify<Dialect, 'postgresql'>;
164
+ driver: Verify<Driver, 'pglite'>;
165
+ dbCredentials: {
166
+ url: string;
167
+ };
162
168
  } | {
163
169
  dialect: Verify<Dialect, 'mysql'>;
164
170
  dbCredentials: {
@@ -207,7 +213,7 @@ type Config = {
207
213
  *
208
214
  * ---
209
215
  * `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
210
- * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
216
+ * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`, `pglite`
211
217
  * If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
212
218
  *
213
219
  * See https://orm.drizzle.team/kit-docs/config-reference#driver
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.24.1-781dea0",
3
+ "version": "0.24.1-edf2ac4",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -51,7 +51,7 @@
51
51
  "@arethetypeswrong/cli": "^0.15.3",
52
52
  "@aws-sdk/client-rds-data": "^3.556.0",
53
53
  "@cloudflare/workers-types": "^4.20230518.0",
54
- "@electric-sql/pglite": "^0.1.5",
54
+ "@electric-sql/pglite": "^0.2.3",
55
55
  "@hono/node-server": "^1.9.0",
56
56
  "@hono/zod-validator": "^0.2.1",
57
57
  "@libsql/client": "^0.4.2",
package/utils.js CHANGED
@@ -570,6 +570,7 @@ __export(utils_exports, {
570
570
  dryJournal: () => dryJournal,
571
571
  isPgArrayType: () => isPgArrayType,
572
572
  kloudMeta: () => kloudMeta,
573
+ normalisePGliteUrl: () => normalisePGliteUrl,
573
574
  normaliseSQLiteUrl: () => normaliseSQLiteUrl,
574
575
  objectValues: () => objectValues,
575
576
  prepareMigrationFolder: () => prepareMigrationFolder,
@@ -5740,6 +5741,12 @@ var normaliseSQLiteUrl = (it, type) => {
5740
5741
  }
5741
5742
  assertUnreachable(type);
5742
5743
  };
5744
+ var normalisePGliteUrl = (it) => {
5745
+ if (it.startsWith("file:")) {
5746
+ return it.substring(5);
5747
+ }
5748
+ return it;
5749
+ };
5743
5750
  function isPgArrayType(sqlType) {
5744
5751
  return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
5745
5752
  }
@@ -5751,6 +5758,7 @@ function isPgArrayType(sqlType) {
5751
5758
  dryJournal,
5752
5759
  isPgArrayType,
5753
5760
  kloudMeta,
5761
+ normalisePGliteUrl,
5754
5762
  normaliseSQLiteUrl,
5755
5763
  objectValues,
5756
5764
  prepareMigrationFolder,
package/utils.mjs CHANGED
@@ -5721,6 +5721,12 @@ var normaliseSQLiteUrl = (it, type) => {
5721
5721
  }
5722
5722
  assertUnreachable(type);
5723
5723
  };
5724
+ var normalisePGliteUrl = (it) => {
5725
+ if (it.startsWith("file:")) {
5726
+ return it.substring(5);
5727
+ }
5728
+ return it;
5729
+ };
5724
5730
  function isPgArrayType(sqlType) {
5725
5731
  return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
5726
5732
  }
@@ -5731,6 +5737,7 @@ export {
5731
5737
  dryJournal,
5732
5738
  isPgArrayType,
5733
5739
  kloudMeta,
5740
+ normalisePGliteUrl,
5734
5741
  normaliseSQLiteUrl,
5735
5742
  objectValues,
5736
5743
  prepareMigrationFolder,