drizzle-kit 0.25.0-d1da3b8 → 0.25.0-f5d46d3
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/api.d.mts +4 -3
- package/api.d.ts +4 -3
- package/api.js +15892 -95323
- package/api.mjs +15891 -95318
- package/bin.cjs +461 -366
- package/common-DYjgLS6u.d.mts +8 -0
- package/common-DYjgLS6u.d.ts +8 -0
- package/index.d.mts +2 -5
- package/index.d.ts +2 -5
- package/package.json +1 -1
- package/utils.js +8 -0
- package/utils.mjs +7 -0
@@ -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?: 'camel' | 'snake';
|
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?: 'camel' | 'snake';
|
122
119
|
migrations?: {
|
123
120
|
table?: string;
|
124
121
|
schema?: string;
|
package/package.json
CHANGED
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,
|