drizzle-kit 0.22.0-407e2e6 → 0.22.0-72736ba

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/bin.cjs CHANGED
@@ -8585,7 +8585,7 @@ var init_outputs = __esm({
8585
8585
  error: (str) => `${source_default.red(`${source_default.white.bgRed(" Invalid input ")} ${str}`)}`,
8586
8586
  warning: (str) => `${source_default.white.bgGray(" Warning ")} ${str}`,
8587
8587
  errorWarning: (str) => `${source_default.red(`${source_default.white.bgRed(" Warning ")} ${str}`)}`,
8588
- fullWarning: (str) => `${source_default.black.bgYellow("[Warning]")} ${source_default.bold(str)}`,
8588
+ fullWarning: (str) => `${source_default.black.bgYellow(" Warning ")} ${source_default.bold(str)}`,
8589
8589
  suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}`,
8590
8590
  info: (str) => `${source_default.grey(str)}`
8591
8591
  };
@@ -8705,7 +8705,14 @@ var init_pg = __esm({
8705
8705
  user: stringType().default("postgres"),
8706
8706
  password: stringType().optional(),
8707
8707
  database: stringType(),
8708
- ssl: coerce.boolean().optional()
8708
+ ssl: unionType([
8709
+ literalType("require"),
8710
+ literalType("allow"),
8711
+ literalType("prefer"),
8712
+ literalType("verify-full"),
8713
+ booleanType(),
8714
+ objectType({}).passthrough()
8715
+ ])
8709
8716
  }),
8710
8717
  objectType({
8711
8718
  url: stringType()
@@ -111712,7 +111719,8 @@ var init_connections = __esm({
111712
111719
  const pg = await Promise.resolve().then(() => __toESM(require_lib3()));
111713
111720
  const { drizzle } = await import("drizzle-orm/node-postgres");
111714
111721
  const { migrate } = await import("drizzle-orm/node-postgres/migrator");
111715
- const client = "url" in credentials2 ? new pg.default.Pool({ connectionString: credentials2.url, max: 1 }) : new pg.default.Pool({ ...credentials2, max: 1 });
111722
+ const ssl = "ssl" in credentials2 ? credentials2.ssl === "prefer" || credentials2.ssl === "require" || credentials2.ssl === "allow" ? { rejectUnauthorized: false } : credentials2.ssl === "verify-full" ? {} : credentials2.ssl : {};
111723
+ const client = "url" in credentials2 ? new pg.default.Pool({ connectionString: credentials2.url, max: 1 }) : new pg.default.Pool({ ...credentials2, ssl, max: 1 });
111716
111724
  const db2 = drizzle(client);
111717
111725
  const migrateFn = async (config) => {
111718
111726
  return migrate(db2, config);
@@ -111764,11 +111772,11 @@ var init_connections = __esm({
111764
111772
  "'@vercel/postgres' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket"
111765
111773
  )
111766
111774
  );
111767
- const { VercelClient: VercelClient2 } = await Promise.resolve().then(() => (init_index_node(), index_node_exports));
111775
+ const { VercelPool: VercelPool2 } = await Promise.resolve().then(() => (init_index_node(), index_node_exports));
111768
111776
  const { drizzle } = await import("drizzle-orm/vercel-postgres");
111769
111777
  const { migrate } = await import("drizzle-orm/vercel-postgres/migrator");
111770
- const client = "url" in credentials2 ? new VercelClient2(credentials2.url) : new VercelClient2(credentials2);
111771
- client.neonConfig.webSocketConstructor = wrapper_default;
111778
+ const ssl = "ssl" in credentials2 ? credentials2.ssl === "prefer" || credentials2.ssl === "require" || credentials2.ssl === "allow" ? { rejectUnauthorized: false } : credentials2.ssl === "verify-full" ? {} : credentials2.ssl : {};
111779
+ const client = "url" in credentials2 ? new VercelPool2({ connectionString: credentials2.url }) : new VercelPool2({ ...credentials2, ssl });
111772
111780
  await client.connect();
111773
111781
  const db2 = drizzle(client);
111774
111782
  const migrateFn = async (config) => {
@@ -111799,16 +111807,16 @@ var init_connections = __esm({
111799
111807
  "'@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket"
111800
111808
  )
111801
111809
  );
111802
- const { Client: Client2 } = await Promise.resolve().then(() => (init_serverless2(), serverless_exports));
111810
+ const { Pool, neonConfig } = await Promise.resolve().then(() => (init_serverless2(), serverless_exports));
111803
111811
  const { drizzle } = await import("drizzle-orm/neon-serverless");
111804
111812
  const { migrate } = await import("drizzle-orm/neon-serverless/migrator");
111805
- const client = "url" in credentials2 ? new Client2(credentials2.url) : new Client2(credentials2);
111813
+ const ssl = "ssl" in credentials2 ? credentials2.ssl === "prefer" || credentials2.ssl === "require" || credentials2.ssl === "allow" ? { rejectUnauthorized: false } : credentials2.ssl === "verify-full" ? {} : credentials2.ssl : {};
111814
+ const client = "url" in credentials2 ? new Pool({ connectionString: credentials2.url, max: 1 }) : new Pool({ ...credentials2, max: 1, ssl });
111815
+ neonConfig.webSocketConstructor = wrapper_default;
111806
111816
  const db2 = drizzle(client);
111807
111817
  const migrateFn = async (config) => {
111808
111818
  return migrate(db2, config);
111809
111819
  };
111810
- client.neonConfig.webSocketConstructor = wrapper_default;
111811
- await client.connect();
111812
111820
  const query = async (sql2, params) => {
111813
111821
  const result = await client.query(sql2, params ?? []);
111814
111822
  return result.rows;
@@ -112065,7 +112073,9 @@ var init_connections = __esm({
112065
112073
  const { default: Database } = await import("better-sqlite3");
112066
112074
  const { drizzle } = await import("drizzle-orm/better-sqlite3");
112067
112075
  const { migrate } = await import("drizzle-orm/better-sqlite3/migrator");
112068
- const sqlite = new Database(normaliseSQLiteUrl(credentials2.url, "better-sqlite"));
112076
+ const sqlite = new Database(
112077
+ normaliseSQLiteUrl(credentials2.url, "better-sqlite")
112078
+ );
112069
112079
  const drzl = drizzle(sqlite);
112070
112080
  const migrateFn = async (config) => {
112071
112081
  return migrate(drzl, config);
package/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { SslOptions } from 'mysql2';
2
2
  import * as zod from 'zod';
3
3
  import { TypeOf } from 'zod';
4
+ import { ConnectionOptions } from 'tls';
4
5
 
5
6
  declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"d1-http">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
6
7
  type Driver = TypeOf<typeof driver>;
@@ -132,14 +133,14 @@ type Config = {
132
133
  };
133
134
  } | {
134
135
  dialect: Verify<Dialect, "postgresql">;
135
- dbCredentials: {
136
+ dbCredentials: ({
136
137
  host: string;
137
138
  port?: number;
138
139
  user?: string;
139
140
  password?: string;
140
141
  database: string;
141
- ssl?: boolean;
142
- } | {
142
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | ConnectionOptions;
143
+ } & {}) | {
143
144
  url: string;
144
145
  };
145
146
  } | {
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { SslOptions } from 'mysql2';
2
2
  import * as zod from 'zod';
3
3
  import { TypeOf } from 'zod';
4
+ import { ConnectionOptions } from 'tls';
4
5
 
5
6
  declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"d1-http">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
6
7
  type Driver = TypeOf<typeof driver>;
@@ -132,14 +133,14 @@ type Config = {
132
133
  };
133
134
  } | {
134
135
  dialect: Verify<Dialect, "postgresql">;
135
- dbCredentials: {
136
+ dbCredentials: ({
136
137
  host: string;
137
138
  port?: number;
138
139
  user?: string;
139
140
  password?: string;
140
141
  database: string;
141
- ssl?: boolean;
142
- } | {
142
+ ssl?: boolean | "require" | "allow" | "prefer" | "verify-full" | ConnectionOptions;
143
+ } & {}) | {
143
144
  url: string;
144
145
  };
145
146
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.22.0-407e2e6",
3
+ "version": "0.22.0-72736ba",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -71,7 +71,7 @@
71
71
  "minimatch": "^7.4.3",
72
72
  "mysql2": "2.3.3",
73
73
  "node-fetch": "^3.3.2",
74
- "pg": "^8.11.3",
74
+ "pg": "^8.11.5",
75
75
  "pluralize": "^8.0.0",
76
76
  "postgres": "^3.4.4",
77
77
  "prettier": "^2.8.1",
package/payload.js CHANGED
@@ -8720,7 +8720,7 @@ var init_outputs = __esm({
8720
8720
  error: (str) => `${source_default.red(`${source_default.white.bgRed(" Invalid input ")} ${str}`)}`,
8721
8721
  warning: (str) => `${source_default.white.bgGray(" Warning ")} ${str}`,
8722
8722
  errorWarning: (str) => `${source_default.red(`${source_default.white.bgRed(" Warning ")} ${str}`)}`,
8723
- fullWarning: (str) => `${source_default.black.bgYellow("[Warning]")} ${source_default.bold(str)}`,
8723
+ fullWarning: (str) => `${source_default.black.bgYellow(" Warning ")} ${source_default.bold(str)}`,
8724
8724
  suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}`,
8725
8725
  info: (str) => `${source_default.grey(str)}`
8726
8726
  };
@@ -8776,7 +8776,14 @@ var init_pg = __esm({
8776
8776
  user: (0, import_zod5.string)().default("postgres"),
8777
8777
  password: (0, import_zod5.string)().optional(),
8778
8778
  database: (0, import_zod5.string)(),
8779
- ssl: import_zod5.coerce.boolean().optional()
8779
+ ssl: (0, import_zod5.union)([
8780
+ (0, import_zod5.literal)("require"),
8781
+ (0, import_zod5.literal)("allow"),
8782
+ (0, import_zod5.literal)("prefer"),
8783
+ (0, import_zod5.literal)("verify-full"),
8784
+ (0, import_zod5.boolean)(),
8785
+ (0, import_zod5.object)({}).passthrough()
8786
+ ])
8780
8787
  }),
8781
8788
  (0, import_zod5.object)({
8782
8789
  url: (0, import_zod5.string)()
package/payload.mjs CHANGED
@@ -8754,7 +8754,7 @@ var init_outputs = __esm({
8754
8754
  error: (str) => `${source_default.red(`${source_default.white.bgRed(" Invalid input ")} ${str}`)}`,
8755
8755
  warning: (str) => `${source_default.white.bgGray(" Warning ")} ${str}`,
8756
8756
  errorWarning: (str) => `${source_default.red(`${source_default.white.bgRed(" Warning ")} ${str}`)}`,
8757
- fullWarning: (str) => `${source_default.black.bgYellow("[Warning]")} ${source_default.bold(str)}`,
8757
+ fullWarning: (str) => `${source_default.black.bgYellow(" Warning ")} ${source_default.bold(str)}`,
8758
8758
  suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}`,
8759
8759
  info: (str) => `${source_default.grey(str)}`
8760
8760
  };
@@ -8797,7 +8797,7 @@ var init_mysql = __esm({
8797
8797
  });
8798
8798
 
8799
8799
  // src/cli/validations/pg.ts
8800
- import { coerce as coerce2, literal as literal4, object as object5, string as string5, union as union6 } from "zod";
8800
+ import { boolean as boolean5, coerce as coerce2, literal as literal4, object as object5, string as string5, union as union6 } from "zod";
8801
8801
  var postgresCredentials;
8802
8802
  var init_pg = __esm({
8803
8803
  "src/cli/validations/pg.ts"() {
@@ -8810,7 +8810,14 @@ var init_pg = __esm({
8810
8810
  user: string5().default("postgres"),
8811
8811
  password: string5().optional(),
8812
8812
  database: string5(),
8813
- ssl: coerce2.boolean().optional()
8813
+ ssl: union6([
8814
+ literal4("require"),
8815
+ literal4("allow"),
8816
+ literal4("prefer"),
8817
+ literal4("verify-full"),
8818
+ boolean5(),
8819
+ object5({}).passthrough()
8820
+ ])
8814
8821
  }),
8815
8822
  object5({
8816
8823
  url: string5()
@@ -8879,7 +8886,7 @@ import {
8879
8886
  object as object7,
8880
8887
  string as string7,
8881
8888
  union as union9,
8882
- boolean as boolean5,
8889
+ boolean as boolean6,
8883
8890
  literal as literal6
8884
8891
  } from "zod";
8885
8892
  var sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
@@ -8903,7 +8910,7 @@ var init_common2 = __esm({
8903
8910
  dialect: dialect3,
8904
8911
  schema: union9([string7(), string7().array()]).optional(),
8905
8912
  out: string7().optional(),
8906
- breakpoints: boolean5().optional().default(true),
8913
+ breakpoints: boolean6().optional().default(true),
8907
8914
  driver: driver.optional(),
8908
8915
  tablesFilter: union9([string7(), string7().array()]).optional(),
8909
8916
  schemaFilter: union9([string7(), string7().array()]).default(["public"])
@@ -8914,7 +8921,7 @@ var init_common2 = __esm({
8914
8921
  introspectParams = object7({
8915
8922
  schema: union9([string7(), string7().array()]).optional(),
8916
8923
  out: string7().optional().default("./drizzle"),
8917
- breakpoints: boolean5().default(true),
8924
+ breakpoints: boolean6().default(true),
8918
8925
  tablesFilter: union9([string7(), string7().array()]).optional(),
8919
8926
  schemaFilter: union9([string7(), string7().array()]).default(["public"]),
8920
8927
  introspect: object7({
@@ -8924,7 +8931,7 @@ var init_common2 = __esm({
8924
8931
  configIntrospectCliSchema = object7({
8925
8932
  schema: union9([string7(), string7().array()]).optional(),
8926
8933
  out: string7().optional().default("./drizzle"),
8927
- breakpoints: boolean5().default(true),
8934
+ breakpoints: boolean6().default(true),
8928
8935
  tablesFilter: union9([string7(), string7().array()]).optional(),
8929
8936
  schemaFilter: union9([string7(), string7().array()]).default(["public"]),
8930
8937
  introspectCasing: union9([literal6("camel"), literal6("preserve")]).default(
@@ -8934,22 +8941,22 @@ var init_common2 = __esm({
8934
8941
  configGenerateSchema = object7({
8935
8942
  schema: union9([string7(), string7().array()]),
8936
8943
  out: string7().optional().default("./drizzle"),
8937
- breakpoints: boolean5().default(true)
8944
+ breakpoints: boolean6().default(true)
8938
8945
  });
8939
8946
  configPushSchema = object7({
8940
8947
  dialect: dialect3,
8941
8948
  schema: union9([string7(), string7().array()]),
8942
8949
  tablesFilter: union9([string7(), string7().array()]).optional(),
8943
8950
  schemaFilter: union9([string7(), string7().array()]).default(["public"]),
8944
- verbose: boolean5().default(false),
8945
- strict: boolean5().default(false),
8951
+ verbose: boolean6().default(false),
8952
+ strict: boolean6().default(false),
8946
8953
  out: string7().optional()
8947
8954
  });
8948
8955
  }
8949
8956
  });
8950
8957
 
8951
8958
  // src/cli/validations/cli.ts
8952
- import { boolean as boolean6, intersection as intersection2, object as object8, string as string8, union as union10 } from "zod";
8959
+ import { boolean as boolean7, intersection as intersection2, object as object8, string as string8, union as union10 } from "zod";
8953
8960
  var cliConfigGenerate, pushParams, pullParams, configCheck, cliConfigCheck;
8954
8961
  var init_cli = __esm({
8955
8962
  "src/cli/validations/cli.ts"() {
@@ -8962,16 +8969,16 @@ var init_cli = __esm({
8962
8969
  out: string8().optional().default("./drizzle"),
8963
8970
  config: string8().optional(),
8964
8971
  name: string8().optional(),
8965
- breakpoints: boolean6().optional().default(true),
8966
- custom: boolean6().optional().default(false)
8972
+ breakpoints: boolean7().optional().default(true),
8973
+ custom: boolean7().optional().default(false)
8967
8974
  }).strict();
8968
8975
  pushParams = object8({
8969
8976
  dialect: dialect3,
8970
8977
  schema: union10([string8(), string8().array()]).optional(),
8971
8978
  tablesFilter: union10([string8(), string8().array()]).optional(),
8972
8979
  schemaFilter: union10([string8(), string8().array()]).optional().default(["public"]),
8973
- verbose: boolean6().optional(),
8974
- strict: boolean6().optional()
8980
+ verbose: boolean7().optional(),
8981
+ strict: boolean7().optional()
8975
8982
  }).passthrough();
8976
8983
  pullParams = object8({
8977
8984
  config: string8().optional(),
@@ -8980,7 +8987,7 @@ var init_cli = __esm({
8980
8987
  tablesFilter: union10([string8(), string8().array()]).optional(),
8981
8988
  schemaFilter: union10([string8(), string8().array()]).optional().default(["public"]),
8982
8989
  introspectCasing: casing,
8983
- breakpoints: boolean6().optional().default(true)
8990
+ breakpoints: boolean7().optional().default(true)
8984
8991
  }).passthrough();
8985
8992
  configCheck = object8({
8986
8993
  dialect: dialect3.optional(),
@@ -12639,7 +12646,7 @@ __export(snapshotsDiffer_exports, {
12639
12646
  });
12640
12647
  import {
12641
12648
  any as any4,
12642
- boolean as boolean7,
12649
+ boolean as boolean8,
12643
12650
  string as string11,
12644
12651
  enum as enumType5,
12645
12652
  object as object11,
@@ -12719,25 +12726,25 @@ var init_snapshotsDiffer = __esm({
12719
12726
  name: string11(),
12720
12727
  type: string11(),
12721
12728
  typeSchema: string11().optional(),
12722
- primaryKey: boolean7().optional(),
12729
+ primaryKey: boolean8().optional(),
12723
12730
  default: any4().optional(),
12724
- notNull: boolean7().optional(),
12731
+ notNull: boolean8().optional(),
12725
12732
  // should it be optional? should if be here?
12726
- autoincrement: boolean7().optional(),
12727
- onUpdate: boolean7().optional(),
12733
+ autoincrement: boolean8().optional(),
12734
+ onUpdate: boolean8().optional(),
12728
12735
  isUnique: any4().optional(),
12729
12736
  uniqueName: string11().optional(),
12730
- nullsNotDistinct: boolean7().optional()
12737
+ nullsNotDistinct: boolean8().optional()
12731
12738
  }).strict();
12732
12739
  alteredColumnSchema = object11({
12733
12740
  name: makeSelfOrChanged(string11()),
12734
12741
  type: makeChanged(string11()).optional(),
12735
12742
  default: makePatched(any4()).optional(),
12736
- primaryKey: makePatched(boolean7()).optional(),
12737
- notNull: makePatched(boolean7()).optional(),
12743
+ primaryKey: makePatched(boolean8()).optional(),
12744
+ notNull: makePatched(boolean8()).optional(),
12738
12745
  typeSchema: makePatched(string11()).optional(),
12739
- onUpdate: makePatched(boolean7()).optional(),
12740
- autoincrement: makePatched(boolean7()).optional()
12746
+ onUpdate: makePatched(boolean8()).optional(),
12747
+ autoincrement: makePatched(boolean8()).optional()
12741
12748
  }).strict();
12742
12749
  enumSchema2 = object11({
12743
12750
  name: string11(),