drizzle-kit 0.25.0-cd0b1a2 → 0.25.0-cf24be9

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
2
+ type Prefix = (typeof prefixes)[number];
3
+ declare const casingTypes: readonly ["snake_case", "camelCase"];
4
+ type CasingType = (typeof casingTypes)[number];
5
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
+ type Driver = (typeof drivers)[number];
7
+
8
+ export type { CasingType as C, Driver as D, Prefix as P };
@@ -0,0 +1,8 @@
1
+ declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
2
+ type Prefix = (typeof prefixes)[number];
3
+ declare const casingTypes: readonly ["snake_case", "camelCase"];
4
+ type CasingType = (typeof casingTypes)[number];
5
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
+ type Driver = (typeof drivers)[number];
7
+
8
+ export type { CasingType as C, Driver as D, Prefix as P };
package/index.d.mts CHANGED
@@ -1,9 +1,5 @@
1
1
  import { ConnectionOptions } from 'tls';
2
-
3
- declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
- type Prefix = (typeof prefixes)[number];
5
- declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
- type Driver = (typeof drivers)[number];
2
+ import { P as Prefix, D as Driver } from './common-DYjgLS6u.mjs';
7
3
 
8
4
  declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso"];
9
5
  type Dialect = (typeof dialects)[number];
@@ -119,6 +115,7 @@ type Config = {
119
115
  schema?: string | string[];
120
116
  verbose?: boolean;
121
117
  strict?: boolean;
118
+ casing?: 'camelCase' | 'snake_case';
122
119
  migrations?: {
123
120
  table?: string;
124
121
  schema?: string;
package/index.d.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  import { ConnectionOptions } from 'tls';
2
-
3
- declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
- type Prefix = (typeof prefixes)[number];
5
- declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
- type Driver = (typeof drivers)[number];
2
+ import { P as Prefix, D as Driver } from './common-DYjgLS6u.js';
7
3
 
8
4
  declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso"];
9
5
  type Dialect = (typeof dialects)[number];
@@ -119,6 +115,7 @@ type Config = {
119
115
  schema?: string | string[];
120
116
  verbose?: boolean;
121
117
  strict?: boolean;
118
+ casing?: 'camelCase' | 'snake_case';
122
119
  migrations?: {
123
120
  table?: string;
124
121
  schema?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.25.0-cd0b1a2",
3
+ "version": "0.25.0-cf24be9",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -80,7 +80,7 @@
80
80
  "commander": "^12.1.0",
81
81
  "dockerode": "^3.3.4",
82
82
  "dotenv": "^16.0.3",
83
- "drizzle-kit": "0.21.2",
83
+ "drizzle-kit": "0.25.0-b1faa33",
84
84
  "drizzle-orm": "workspace:./drizzle-orm/dist",
85
85
  "env-paths": "^3.0.0",
86
86
  "esbuild-node-externals": "^1.9.0",
package/utils.js CHANGED
@@ -569,6 +569,7 @@ __export(utils_exports, {
569
569
  copy: () => copy,
570
570
  dryJournal: () => dryJournal,
571
571
  findAddedAndRemoved: () => findAddedAndRemoved,
572
+ getColumnCasing: () => getColumnCasing,
572
573
  isPgArrayType: () => isPgArrayType,
573
574
  kloudMeta: () => kloudMeta,
574
575
  normalisePGliteUrl: () => normalisePGliteUrl,
@@ -1073,6 +1074,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1073
1074
  var source_default = chalk;
1074
1075
 
1075
1076
  // src/utils.ts
1077
+ var import_casing = require("drizzle-orm/casing");
1076
1078
  var import_fs = require("fs");
1077
1079
  var import_path = require("path");
1078
1080
  var import_url = require("url");
@@ -5760,6 +5762,11 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
5760
5762
  const removedColumns = columnNames1.filter((it) => !set2.has(it));
5761
5763
  return { addedColumns, removedColumns };
5762
5764
  }
5765
+ function getColumnCasing(column4, casing) {
5766
+ if (!column4.name)
5767
+ return "";
5768
+ return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? (0, import_casing.toCamelCase)(column4.name) : (0, import_casing.toSnakeCase)(column4.name);
5769
+ }
5763
5770
  // Annotate the CommonJS export names for ESM import in node:
5764
5771
  0 && (module.exports = {
5765
5772
  assertV1OutFolder,
@@ -5767,6 +5774,7 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
5767
5774
  copy,
5768
5775
  dryJournal,
5769
5776
  findAddedAndRemoved,
5777
+ getColumnCasing,
5770
5778
  isPgArrayType,
5771
5779
  kloudMeta,
5772
5780
  normalisePGliteUrl,
package/utils.mjs CHANGED
@@ -1052,6 +1052,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1052
1052
  var source_default = chalk;
1053
1053
 
1054
1054
  // src/utils.ts
1055
+ import { toCamelCase, toSnakeCase } from "drizzle-orm/casing";
1055
1056
  import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "fs";
1056
1057
  import { join } from "path";
1057
1058
  import { parse } from "url";
@@ -5739,12 +5740,18 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
5739
5740
  const removedColumns = columnNames1.filter((it) => !set2.has(it));
5740
5741
  return { addedColumns, removedColumns };
5741
5742
  }
5743
+ function getColumnCasing(column4, casing) {
5744
+ if (!column4.name)
5745
+ return "";
5746
+ return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? toCamelCase(column4.name) : toSnakeCase(column4.name);
5747
+ }
5742
5748
  export {
5743
5749
  assertV1OutFolder,
5744
5750
  columnRenameKey,
5745
5751
  copy,
5746
5752
  dryJournal,
5747
5753
  findAddedAndRemoved,
5754
+ getColumnCasing,
5748
5755
  isPgArrayType,
5749
5756
  kloudMeta,
5750
5757
  normalisePGliteUrl,