@conorroberts/utils 0.0.91 → 0.0.92
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/dist/db.d.mts +1 -0
- package/dist/db.mjs +294 -0
- package/dist/db.mjs.map +1 -0
- package/dist/oxfmt/config.json +43 -0
- package/package.json +10 -1
package/dist/db.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/db.mjs
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { parseArgs } from "node:util";
|
|
2
|
+
import { consola } from "consola";
|
|
3
|
+
import { drizzle } from "drizzle-orm/planetscale-serverless";
|
|
4
|
+
import { migrate } from "drizzle-orm/planetscale-serverless/migrator";
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
//#region src/db/migrate.ts
|
|
10
|
+
const { values } = parseArgs({
|
|
11
|
+
options: {
|
|
12
|
+
"migrations-folder": { type: "string" },
|
|
13
|
+
host: { type: "string" },
|
|
14
|
+
username: { type: "string" },
|
|
15
|
+
password: { type: "string" }
|
|
16
|
+
},
|
|
17
|
+
strict: true
|
|
18
|
+
});
|
|
19
|
+
const migrationsFolder = values["migrations-folder"];
|
|
20
|
+
if (!migrationsFolder) {
|
|
21
|
+
consola.error("Missing required argument: --migrations-folder");
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
const host = values.host ?? String(process.env.DATABASE_HOST);
|
|
25
|
+
const username = values.username ?? String(process.env.DATABASE_USERNAME);
|
|
26
|
+
const password = values.password ?? String(process.env.DATABASE_PASSWORD);
|
|
27
|
+
const runMigration = async () => {
|
|
28
|
+
consola.log("Running database migrations...");
|
|
29
|
+
const db = drizzle({ connection: {
|
|
30
|
+
host,
|
|
31
|
+
username,
|
|
32
|
+
password
|
|
33
|
+
} });
|
|
34
|
+
try {
|
|
35
|
+
await migrate(db, { migrationsFolder });
|
|
36
|
+
consola.log("[OK] Migrations completed successfully!");
|
|
37
|
+
} catch (error) {
|
|
38
|
+
consola.error("[FAIL] Migration failed:", error);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
runMigration().catch((error) => {
|
|
43
|
+
consola.error("[FAIL] Migration script failed:", error);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/db/validateSchema.ts
|
|
49
|
+
/**
|
|
50
|
+
* Database Schema Validator
|
|
51
|
+
*
|
|
52
|
+
* This script validates the database schema by analyzing all MySQL table definitions
|
|
53
|
+
* from Drizzle migration metadata and reports any table, column, or constraint names
|
|
54
|
+
* that exceed MySQL's maximum length limits.
|
|
55
|
+
*
|
|
56
|
+
* MySQL Limits:
|
|
57
|
+
* - Table/Column names: 64 characters
|
|
58
|
+
* - Constraint names: 64 characters
|
|
59
|
+
*
|
|
60
|
+
* Usage:
|
|
61
|
+
* - Basic: pnpm -F scripts validate:db-schema
|
|
62
|
+
* - Verbose: pnpm -F scripts validate:db-schema -- --verbose
|
|
63
|
+
*
|
|
64
|
+
* The verbose mode shows all constraint names being checked, sorted by length.
|
|
65
|
+
*
|
|
66
|
+
* This validation runs automatically:
|
|
67
|
+
* - After `pnpm generate` (blocks if violations found)
|
|
68
|
+
* - In CI/CD as part of PR checks
|
|
69
|
+
*/
|
|
70
|
+
const MAX_IDENTIFIER_LENGTH = 64;
|
|
71
|
+
const MAX_CONSTRAINT_NAME_LENGTH = 64;
|
|
72
|
+
const getLatestSnapshot = () => {
|
|
73
|
+
const metaDir = join(fileURLToPath(new URL(".", import.meta.url)), "../../../common/migrations/meta");
|
|
74
|
+
const journalPath = join(metaDir, "_journal.json");
|
|
75
|
+
const entries = JSON.parse(readFileSync(journalPath, "utf-8")).entries;
|
|
76
|
+
const latestEntry = entries[entries.length - 1];
|
|
77
|
+
if (!latestEntry) throw new Error("No migrations found in journal");
|
|
78
|
+
const snapshotPath = join(metaDir, `${latestEntry.idx.toString().padStart(4, "0")}_snapshot.json`);
|
|
79
|
+
return JSON.parse(readFileSync(snapshotPath, "utf-8"));
|
|
80
|
+
};
|
|
81
|
+
const validateDatabaseSchema = (verbose = false) => {
|
|
82
|
+
const issues = [];
|
|
83
|
+
const allConstraints = [];
|
|
84
|
+
const snapshot = getLatestSnapshot();
|
|
85
|
+
const tables = Object.values(snapshot.tables);
|
|
86
|
+
tables.forEach((table) => {
|
|
87
|
+
if (table.name.length > MAX_IDENTIFIER_LENGTH) issues.push({
|
|
88
|
+
type: "table",
|
|
89
|
+
tableName: table.name,
|
|
90
|
+
name: table.name,
|
|
91
|
+
actualLength: table.name.length,
|
|
92
|
+
maxLength: MAX_IDENTIFIER_LENGTH
|
|
93
|
+
});
|
|
94
|
+
Object.values(table.columns).forEach((column) => {
|
|
95
|
+
if (column.name.length > MAX_IDENTIFIER_LENGTH) issues.push({
|
|
96
|
+
type: "column",
|
|
97
|
+
tableName: table.name,
|
|
98
|
+
name: column.name,
|
|
99
|
+
actualLength: column.name.length,
|
|
100
|
+
maxLength: MAX_IDENTIFIER_LENGTH
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
Object.values(table.foreignKeys).forEach((fk) => {
|
|
104
|
+
allConstraints.push({
|
|
105
|
+
table: table.name,
|
|
106
|
+
type: "FK",
|
|
107
|
+
name: fk.name,
|
|
108
|
+
length: fk.name.length
|
|
109
|
+
});
|
|
110
|
+
if (fk.name.length > MAX_CONSTRAINT_NAME_LENGTH) issues.push({
|
|
111
|
+
type: "constraint",
|
|
112
|
+
tableName: table.name,
|
|
113
|
+
name: fk.name,
|
|
114
|
+
actualLength: fk.name.length,
|
|
115
|
+
maxLength: MAX_CONSTRAINT_NAME_LENGTH,
|
|
116
|
+
constraintType: "foreign_key"
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
Object.values(table.compositePrimaryKeys).forEach((pk) => {
|
|
120
|
+
const pkType = pk.columns.length > 1 ? "PK (composite)" : "PK";
|
|
121
|
+
allConstraints.push({
|
|
122
|
+
table: table.name,
|
|
123
|
+
type: pkType,
|
|
124
|
+
name: pk.name,
|
|
125
|
+
length: pk.name.length
|
|
126
|
+
});
|
|
127
|
+
if (pk.name.length > MAX_CONSTRAINT_NAME_LENGTH) issues.push({
|
|
128
|
+
type: "constraint",
|
|
129
|
+
tableName: table.name,
|
|
130
|
+
name: pk.name,
|
|
131
|
+
actualLength: pk.name.length,
|
|
132
|
+
maxLength: MAX_CONSTRAINT_NAME_LENGTH,
|
|
133
|
+
constraintType: "primary_key"
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
Object.values(table.uniqueConstraints).forEach((unique) => {
|
|
137
|
+
allConstraints.push({
|
|
138
|
+
table: table.name,
|
|
139
|
+
type: "UNIQUE",
|
|
140
|
+
name: unique.name,
|
|
141
|
+
length: unique.name.length
|
|
142
|
+
});
|
|
143
|
+
if (unique.name.length > MAX_CONSTRAINT_NAME_LENGTH) issues.push({
|
|
144
|
+
type: "constraint",
|
|
145
|
+
tableName: table.name,
|
|
146
|
+
name: unique.name,
|
|
147
|
+
actualLength: unique.name.length,
|
|
148
|
+
maxLength: MAX_CONSTRAINT_NAME_LENGTH,
|
|
149
|
+
constraintType: "unique"
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
Object.values(table.indexes).forEach((index) => {
|
|
153
|
+
allConstraints.push({
|
|
154
|
+
table: table.name,
|
|
155
|
+
type: "INDEX",
|
|
156
|
+
name: index.name,
|
|
157
|
+
length: index.name.length
|
|
158
|
+
});
|
|
159
|
+
if (index.name.length > MAX_CONSTRAINT_NAME_LENGTH) issues.push({
|
|
160
|
+
type: "constraint",
|
|
161
|
+
tableName: table.name,
|
|
162
|
+
name: index.name,
|
|
163
|
+
actualLength: index.name.length,
|
|
164
|
+
maxLength: MAX_CONSTRAINT_NAME_LENGTH,
|
|
165
|
+
constraintType: "index"
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
if (verbose) {
|
|
170
|
+
consola.box("All Constraints Checked");
|
|
171
|
+
allConstraints.sort((a, b) => b.length - a.length).forEach((constraint) => {
|
|
172
|
+
const exceeds = constraint.length > MAX_CONSTRAINT_NAME_LENGTH;
|
|
173
|
+
const message = `${`[${constraint.length.toString().padStart(2)} chars]`} ${constraint.type.padEnd(15)} ${constraint.name} (${constraint.table})`;
|
|
174
|
+
if (exceeds) consola.error(message);
|
|
175
|
+
else consola.success(message);
|
|
176
|
+
});
|
|
177
|
+
consola.log("");
|
|
178
|
+
}
|
|
179
|
+
consola.box("MySQL Name Length Analysis");
|
|
180
|
+
consola.info(`Maximum identifier length: ${MAX_IDENTIFIER_LENGTH} characters`);
|
|
181
|
+
consola.info(`Maximum constraint name length: ${MAX_CONSTRAINT_NAME_LENGTH} characters`);
|
|
182
|
+
consola.info(`Analyzed ${tables.length} tables`);
|
|
183
|
+
consola.log("");
|
|
184
|
+
consola.start("Tables analyzed:");
|
|
185
|
+
tables.forEach((table) => {
|
|
186
|
+
const columnCount = Object.keys(table.columns).length;
|
|
187
|
+
const fkCount = Object.keys(table.foreignKeys).length;
|
|
188
|
+
const pkCount = Object.keys(table.compositePrimaryKeys).length;
|
|
189
|
+
const uniqueCount = Object.keys(table.uniqueConstraints).length;
|
|
190
|
+
const indexCount = Object.keys(table.indexes).length;
|
|
191
|
+
const parts = [];
|
|
192
|
+
parts.push(`${columnCount} columns`);
|
|
193
|
+
if (fkCount > 0) parts.push(`${fkCount} FKs`);
|
|
194
|
+
if (pkCount > 0) parts.push(`${pkCount} PKs`);
|
|
195
|
+
if (uniqueCount > 0) parts.push(`${uniqueCount} unique`);
|
|
196
|
+
if (indexCount > 0) parts.push(`${indexCount} indexes`);
|
|
197
|
+
consola.log(` - ${table.name} (${parts.join(", ")})`);
|
|
198
|
+
});
|
|
199
|
+
consola.log("");
|
|
200
|
+
if (issues.length === 0) {
|
|
201
|
+
consola.success("No name length issues found!");
|
|
202
|
+
return 0;
|
|
203
|
+
}
|
|
204
|
+
consola.warn(`Found ${issues.length} name length issue(s):`);
|
|
205
|
+
consola.log("");
|
|
206
|
+
const tableIssues = issues.filter((i) => i.type === "table");
|
|
207
|
+
const columnIssues = issues.filter((i) => i.type === "column");
|
|
208
|
+
const constraintIssues = issues.filter((i) => i.type === "constraint");
|
|
209
|
+
if (tableIssues.length > 0) {
|
|
210
|
+
consola.error("Table Name Issues:");
|
|
211
|
+
tableIssues.forEach((issue) => {
|
|
212
|
+
consola.log(` - Table: ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`);
|
|
213
|
+
});
|
|
214
|
+
consola.log("");
|
|
215
|
+
}
|
|
216
|
+
if (columnIssues.length > 0) {
|
|
217
|
+
consola.error("Column Name Issues:");
|
|
218
|
+
columnIssues.forEach((issue) => {
|
|
219
|
+
consola.log(` - ${issue.tableName}.${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`);
|
|
220
|
+
});
|
|
221
|
+
consola.log("");
|
|
222
|
+
}
|
|
223
|
+
if (constraintIssues.length > 0) {
|
|
224
|
+
consola.error("Constraint Name Issues:");
|
|
225
|
+
const fkIssues = constraintIssues.filter((i) => i.constraintType === "foreign_key");
|
|
226
|
+
const pkIssues = constraintIssues.filter((i) => i.constraintType === "primary_key");
|
|
227
|
+
const uniqueIssues = constraintIssues.filter((i) => i.constraintType === "unique");
|
|
228
|
+
const indexIssues = constraintIssues.filter((i) => i.constraintType === "index");
|
|
229
|
+
if (fkIssues.length > 0) {
|
|
230
|
+
consola.log(" Foreign Keys:");
|
|
231
|
+
fkIssues.forEach((issue) => {
|
|
232
|
+
consola.log(` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`);
|
|
233
|
+
consola.log(` Table: ${issue.tableName}`);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (pkIssues.length > 0) {
|
|
237
|
+
consola.log(" Primary Keys:");
|
|
238
|
+
pkIssues.forEach((issue) => {
|
|
239
|
+
consola.log(` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`);
|
|
240
|
+
consola.log(` Table: ${issue.tableName}`);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (uniqueIssues.length > 0) {
|
|
244
|
+
consola.log(" Unique Constraints:");
|
|
245
|
+
uniqueIssues.forEach((issue) => {
|
|
246
|
+
consola.log(` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`);
|
|
247
|
+
consola.log(` Table: ${issue.tableName}`);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (indexIssues.length > 0) {
|
|
251
|
+
consola.log(" Indexes:");
|
|
252
|
+
indexIssues.forEach((issue) => {
|
|
253
|
+
consola.log(` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`);
|
|
254
|
+
consola.log(` Table: ${issue.tableName}`);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
consola.log("");
|
|
258
|
+
}
|
|
259
|
+
consola.box("Summary");
|
|
260
|
+
consola.info(`Total issues: ${issues.length}`);
|
|
261
|
+
consola.info(` - Table names: ${tableIssues.length}`);
|
|
262
|
+
consola.info(` - Column names: ${columnIssues.length}`);
|
|
263
|
+
consola.info(` - Constraint names: ${constraintIssues.length}`);
|
|
264
|
+
if (constraintIssues.length > 0) {
|
|
265
|
+
const fkCount = constraintIssues.filter((i) => i.constraintType === "foreign_key").length;
|
|
266
|
+
const pkCount = constraintIssues.filter((i) => i.constraintType === "primary_key").length;
|
|
267
|
+
const uniqueCount = constraintIssues.filter((i) => i.constraintType === "unique").length;
|
|
268
|
+
const indexCount = constraintIssues.filter((i) => i.constraintType === "index").length;
|
|
269
|
+
consola.info(` - Foreign keys: ${fkCount}`);
|
|
270
|
+
consola.info(` - Primary keys: ${pkCount}`);
|
|
271
|
+
consola.info(` - Unique constraints: ${uniqueCount}`);
|
|
272
|
+
consola.info(` - Indexes: ${indexCount}`);
|
|
273
|
+
}
|
|
274
|
+
consola.log("");
|
|
275
|
+
consola.fail("MIGRATION BLOCKED: Name length violations detected!");
|
|
276
|
+
consola.log("");
|
|
277
|
+
consola.start("Action required:");
|
|
278
|
+
consola.log("1. Review the issues listed above");
|
|
279
|
+
consola.log("2. Shorten table/column names in your schema definitions");
|
|
280
|
+
consola.log("3. For foreign keys, consider:");
|
|
281
|
+
consola.log(" - Shortening table names");
|
|
282
|
+
consola.log(" - Shortening column names");
|
|
283
|
+
consola.log(" - Using shorter referenced table names");
|
|
284
|
+
consola.log("4. Run 'pnpm generate' again after making changes");
|
|
285
|
+
consola.log("5. Run this check with --verbose to see all constraint names");
|
|
286
|
+
consola.log("");
|
|
287
|
+
return 1;
|
|
288
|
+
};
|
|
289
|
+
const exitCode = validateDatabaseSchema(process.argv.includes("--verbose") || process.argv.includes("-v"));
|
|
290
|
+
process.exit(exitCode);
|
|
291
|
+
|
|
292
|
+
//#endregion
|
|
293
|
+
export { };
|
|
294
|
+
//# sourceMappingURL=db.mjs.map
|
package/dist/db.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.mjs","names":["entries: JournalEntry[]","issues: NameLengthIssue[]","allConstraints: Array<{ table: string; type: string; name: string; length: number }>","parts: string[]"],"sources":["../src/db/migrate.ts","../src/db/validateSchema.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\r\nimport { consola } from \"consola\";\r\nimport { drizzle } from \"drizzle-orm/planetscale-serverless\";\r\nimport { migrate } from \"drizzle-orm/planetscale-serverless/migrator\";\r\n\r\nconst { values } = parseArgs({\r\n options: {\r\n \"migrations-folder\": { type: \"string\" },\r\n host: { type: \"string\" },\r\n username: { type: \"string\" },\r\n password: { type: \"string\" },\r\n },\r\n strict: true,\r\n});\r\n\r\nconst migrationsFolder = values[\"migrations-folder\"];\r\n\r\nif (!migrationsFolder) {\r\n consola.error(\"Missing required argument: --migrations-folder\");\r\n process.exit(1);\r\n}\r\n\r\nconst host = values.host ?? String(process.env.DATABASE_HOST);\r\nconst username = values.username ?? String(process.env.DATABASE_USERNAME);\r\nconst password = values.password ?? String(process.env.DATABASE_PASSWORD);\r\n\r\nconst runMigration = async () => {\r\n consola.log(\"Running database migrations...\");\r\n\r\n const db = drizzle({\r\n connection: { host, username, password },\r\n });\r\n\r\n try {\r\n await migrate(db, { migrationsFolder });\r\n consola.log(\"[OK] Migrations completed successfully!\");\r\n } catch (error) {\r\n consola.error(\"[FAIL] Migration failed:\", error);\r\n process.exit(1);\r\n }\r\n};\r\n\r\nrunMigration().catch((error) => {\r\n consola.error(\"[FAIL] Migration script failed:\", error);\r\n process.exit(1);\r\n});\r\n","/**\r\n * Database Schema Validator\r\n *\r\n * This script validates the database schema by analyzing all MySQL table definitions\r\n * from Drizzle migration metadata and reports any table, column, or constraint names\r\n * that exceed MySQL's maximum length limits.\r\n *\r\n * MySQL Limits:\r\n * - Table/Column names: 64 characters\r\n * - Constraint names: 64 characters\r\n *\r\n * Usage:\r\n * - Basic: pnpm -F scripts validate:db-schema\r\n * - Verbose: pnpm -F scripts validate:db-schema -- --verbose\r\n *\r\n * The verbose mode shows all constraint names being checked, sorted by length.\r\n *\r\n * This validation runs automatically:\r\n * - After `pnpm generate` (blocks if violations found)\r\n * - In CI/CD as part of PR checks\r\n */\r\n\r\nimport { consola } from \"consola\";\r\nimport { readFileSync } from \"node:fs\";\r\nimport { join } from \"node:path\";\r\nimport { fileURLToPath } from \"node:url\";\r\n\r\ninterface NameLengthIssue {\r\n type: \"table\" | \"column\" | \"constraint\";\r\n tableName: string;\r\n name: string;\r\n actualLength: number;\r\n maxLength: number;\r\n constraintType?: \"foreign_key\" | \"primary_key\" | \"unique\" | \"index\";\r\n}\r\n\r\ninterface DrizzleSnapshot {\r\n tables: Record<string, DrizzleTable>;\r\n}\r\n\r\ninterface DrizzleTable {\r\n name: string;\r\n columns: Record<string, DrizzleColumn>;\r\n indexes: Record<string, DrizzleIndex>;\r\n foreignKeys: Record<string, DrizzleForeignKey>;\r\n compositePrimaryKeys: Record<string, DrizzlePrimaryKey>;\r\n uniqueConstraints: Record<string, DrizzleUniqueConstraint>;\r\n}\r\n\r\ninterface DrizzleColumn {\r\n name: string;\r\n type: string;\r\n primaryKey: boolean;\r\n notNull: boolean;\r\n autoincrement: boolean;\r\n}\r\n\r\ninterface DrizzleIndex {\r\n name: string;\r\n columns: string[];\r\n}\r\n\r\ninterface DrizzleForeignKey {\r\n name: string;\r\n tableFrom: string;\r\n tableTo: string;\r\n columnsFrom: string[];\r\n columnsTo: string[];\r\n}\r\n\r\ninterface DrizzlePrimaryKey {\r\n name: string;\r\n columns: string[];\r\n}\r\n\r\ninterface DrizzleUniqueConstraint {\r\n name: string;\r\n columns: string[];\r\n}\r\n\r\nconst MAX_IDENTIFIER_LENGTH = 64;\r\nconst MAX_CONSTRAINT_NAME_LENGTH = 64;\r\n\r\nconst getLatestSnapshot = (): DrizzleSnapshot => {\r\n const currentDir = fileURLToPath(new URL(\".\", import.meta.url));\r\n const metaDir = join(currentDir, \"../../../common/migrations/meta\");\r\n\r\n // Read the journal to find the latest migration\r\n const journalPath = join(metaDir, \"_journal.json\");\r\n const parsedJournal = JSON.parse(readFileSync(journalPath, \"utf-8\"));\r\n\r\n interface JournalEntry {\r\n tag: string;\r\n idx: number;\r\n }\r\n\r\n const entries: JournalEntry[] = parsedJournal.entries;\r\n const latestEntry = entries[entries.length - 1];\r\n\r\n if (!latestEntry) {\r\n throw new Error(\"No migrations found in journal\");\r\n }\r\n\r\n // Read the latest snapshot\r\n const snapshotPath = join(metaDir, `${latestEntry.idx.toString().padStart(4, \"0\")}_snapshot.json`);\r\n const parsedSnapshot = JSON.parse(readFileSync(snapshotPath, \"utf-8\"));\r\n const snapshot: DrizzleSnapshot = parsedSnapshot;\r\n\r\n return snapshot;\r\n};\r\n\r\nconst validateDatabaseSchema = (verbose = false): number => {\r\n const issues: NameLengthIssue[] = [];\r\n const allConstraints: Array<{ table: string; type: string; name: string; length: number }> = [];\r\n\r\n const snapshot = getLatestSnapshot();\r\n const tables = Object.values(snapshot.tables);\r\n\r\n tables.forEach((table) => {\r\n // Check table name length\r\n if (table.name.length > MAX_IDENTIFIER_LENGTH) {\r\n issues.push({\r\n type: \"table\",\r\n tableName: table.name,\r\n name: table.name,\r\n actualLength: table.name.length,\r\n maxLength: MAX_IDENTIFIER_LENGTH,\r\n });\r\n }\r\n\r\n // Check column name lengths\r\n Object.values(table.columns).forEach((column) => {\r\n if (column.name.length > MAX_IDENTIFIER_LENGTH) {\r\n issues.push({\r\n type: \"column\",\r\n tableName: table.name,\r\n name: column.name,\r\n actualLength: column.name.length,\r\n maxLength: MAX_IDENTIFIER_LENGTH,\r\n });\r\n }\r\n });\r\n\r\n // Check foreign key constraint names\r\n Object.values(table.foreignKeys).forEach((fk) => {\r\n allConstraints.push({ table: table.name, type: \"FK\", name: fk.name, length: fk.name.length });\r\n if (fk.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: fk.name,\r\n actualLength: fk.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"foreign_key\",\r\n });\r\n }\r\n });\r\n\r\n // Check primary key constraint names\r\n Object.values(table.compositePrimaryKeys).forEach((pk) => {\r\n const pkType = pk.columns.length > 1 ? \"PK (composite)\" : \"PK\";\r\n allConstraints.push({ table: table.name, type: pkType, name: pk.name, length: pk.name.length });\r\n if (pk.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: pk.name,\r\n actualLength: pk.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"primary_key\",\r\n });\r\n }\r\n });\r\n\r\n // Check unique constraint names\r\n Object.values(table.uniqueConstraints).forEach((unique) => {\r\n allConstraints.push({ table: table.name, type: \"UNIQUE\", name: unique.name, length: unique.name.length });\r\n if (unique.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: unique.name,\r\n actualLength: unique.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"unique\",\r\n });\r\n }\r\n });\r\n\r\n // Check index names\r\n Object.values(table.indexes).forEach((index) => {\r\n allConstraints.push({ table: table.name, type: \"INDEX\", name: index.name, length: index.name.length });\r\n if (index.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: index.name,\r\n actualLength: index.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"index\",\r\n });\r\n }\r\n });\r\n });\r\n\r\n // Verbose mode: show all constraints checked\r\n if (verbose) {\r\n consola.box(\"All Constraints Checked\");\r\n const sortedConstraints = allConstraints.sort((a, b) => b.length - a.length);\r\n sortedConstraints.forEach((constraint) => {\r\n const exceeds = constraint.length > MAX_CONSTRAINT_NAME_LENGTH;\r\n const lengthStr = `[${constraint.length.toString().padStart(2)} chars]`;\r\n const typeStr = constraint.type.padEnd(15);\r\n const message = `${lengthStr} ${typeStr} ${constraint.name} (${constraint.table})`;\r\n if (exceeds) {\r\n consola.error(message);\r\n } else {\r\n consola.success(message);\r\n }\r\n });\r\n consola.log(\"\");\r\n }\r\n\r\n // Print report\r\n consola.box(\"MySQL Name Length Analysis\");\r\n consola.info(`Maximum identifier length: ${MAX_IDENTIFIER_LENGTH} characters`);\r\n consola.info(`Maximum constraint name length: ${MAX_CONSTRAINT_NAME_LENGTH} characters`);\r\n consola.info(`Analyzed ${tables.length} tables`);\r\n consola.log(\"\");\r\n\r\n // Show table summary\r\n consola.start(\"Tables analyzed:\");\r\n tables.forEach((table) => {\r\n const columnCount = Object.keys(table.columns).length;\r\n const fkCount = Object.keys(table.foreignKeys).length;\r\n const pkCount = Object.keys(table.compositePrimaryKeys).length;\r\n const uniqueCount = Object.keys(table.uniqueConstraints).length;\r\n const indexCount = Object.keys(table.indexes).length;\r\n\r\n const parts: string[] = [];\r\n parts.push(`${columnCount} columns`);\r\n if (fkCount > 0) {\r\n parts.push(`${fkCount} FKs`);\r\n }\r\n if (pkCount > 0) {\r\n parts.push(`${pkCount} PKs`);\r\n }\r\n if (uniqueCount > 0) {\r\n parts.push(`${uniqueCount} unique`);\r\n }\r\n if (indexCount > 0) {\r\n parts.push(`${indexCount} indexes`);\r\n }\r\n\r\n consola.log(` - ${table.name} (${parts.join(\", \")})`);\r\n });\r\n consola.log(\"\");\r\n\r\n if (issues.length === 0) {\r\n consola.success(\"No name length issues found!\");\r\n return 0;\r\n }\r\n\r\n consola.warn(`Found ${issues.length} name length issue(s):`);\r\n consola.log(\"\");\r\n\r\n const tableIssues = issues.filter((i) => i.type === \"table\");\r\n const columnIssues = issues.filter((i) => i.type === \"column\");\r\n const constraintIssues = issues.filter((i) => i.type === \"constraint\");\r\n\r\n if (tableIssues.length > 0) {\r\n consola.error(\"Table Name Issues:\");\r\n tableIssues.forEach((issue) => {\r\n consola.log(\r\n ` - Table: ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n });\r\n consola.log(\"\");\r\n }\r\n\r\n if (columnIssues.length > 0) {\r\n consola.error(\"Column Name Issues:\");\r\n columnIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.tableName}.${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n });\r\n consola.log(\"\");\r\n }\r\n\r\n if (constraintIssues.length > 0) {\r\n consola.error(\"Constraint Name Issues:\");\r\n const fkIssues = constraintIssues.filter((i) => i.constraintType === \"foreign_key\");\r\n const pkIssues = constraintIssues.filter((i) => i.constraintType === \"primary_key\");\r\n const uniqueIssues = constraintIssues.filter((i) => i.constraintType === \"unique\");\r\n const indexIssues = constraintIssues.filter((i) => i.constraintType === \"index\");\r\n\r\n if (fkIssues.length > 0) {\r\n consola.log(\" Foreign Keys:\");\r\n fkIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n\r\n if (pkIssues.length > 0) {\r\n consola.log(\" Primary Keys:\");\r\n pkIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n\r\n if (uniqueIssues.length > 0) {\r\n consola.log(\" Unique Constraints:\");\r\n uniqueIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n\r\n if (indexIssues.length > 0) {\r\n consola.log(\" Indexes:\");\r\n indexIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n consola.log(\"\");\r\n }\r\n\r\n consola.box(\"Summary\");\r\n consola.info(`Total issues: ${issues.length}`);\r\n consola.info(` - Table names: ${tableIssues.length}`);\r\n consola.info(` - Column names: ${columnIssues.length}`);\r\n consola.info(` - Constraint names: ${constraintIssues.length}`);\r\n if (constraintIssues.length > 0) {\r\n const fkCount = constraintIssues.filter((i) => i.constraintType === \"foreign_key\").length;\r\n const pkCount = constraintIssues.filter((i) => i.constraintType === \"primary_key\").length;\r\n const uniqueCount = constraintIssues.filter((i) => i.constraintType === \"unique\").length;\r\n const indexCount = constraintIssues.filter((i) => i.constraintType === \"index\").length;\r\n consola.info(` - Foreign keys: ${fkCount}`);\r\n consola.info(` - Primary keys: ${pkCount}`);\r\n consola.info(` - Unique constraints: ${uniqueCount}`);\r\n consola.info(` - Indexes: ${indexCount}`);\r\n }\r\n consola.log(\"\");\r\n\r\n // Print actionable feedback\r\n consola.fail(\"MIGRATION BLOCKED: Name length violations detected!\");\r\n consola.log(\"\");\r\n consola.start(\"Action required:\");\r\n consola.log(\"1. Review the issues listed above\");\r\n consola.log(\"2. Shorten table/column names in your schema definitions\");\r\n consola.log(\"3. For foreign keys, consider:\");\r\n consola.log(\" - Shortening table names\");\r\n consola.log(\" - Shortening column names\");\r\n consola.log(\" - Using shorter referenced table names\");\r\n consola.log(\"4. Run 'pnpm generate' again after making changes\");\r\n consola.log(\"5. Run this check with --verbose to see all constraint names\");\r\n consola.log(\"\");\r\n\r\n return 1;\r\n};\r\n\r\nconst verbose = process.argv.includes(\"--verbose\") || process.argv.includes(\"-v\");\r\nconst exitCode = validateDatabaseSchema(verbose);\r\nprocess.exit(exitCode);\r\n"],"mappings":";;;;;;;;;AAKA,MAAM,EAAE,WAAW,UAAU;CAC3B,SAAS;EACP,qBAAqB,EAAE,MAAM,UAAU;EACvC,MAAM,EAAE,MAAM,UAAU;EACxB,UAAU,EAAE,MAAM,UAAU;EAC5B,UAAU,EAAE,MAAM,UAAU;EAC7B;CACD,QAAQ;CACT,CAAC;AAEF,MAAM,mBAAmB,OAAO;AAEhC,IAAI,CAAC,kBAAkB;AACrB,SAAQ,MAAM,iDAAiD;AAC/D,SAAQ,KAAK,EAAE;;AAGjB,MAAM,OAAO,OAAO,QAAQ,OAAO,QAAQ,IAAI,cAAc;AAC7D,MAAM,WAAW,OAAO,YAAY,OAAO,QAAQ,IAAI,kBAAkB;AACzE,MAAM,WAAW,OAAO,YAAY,OAAO,QAAQ,IAAI,kBAAkB;AAEzE,MAAM,eAAe,YAAY;AAC/B,SAAQ,IAAI,iCAAiC;CAE7C,MAAM,KAAK,QAAQ,EACjB,YAAY;EAAE;EAAM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EAC/B,MAAM,UAAU,iBAAiB,QAAQ,MAAM,EAAE,mBAAmB,cAAc,CAAC;EACnF,MAAM,UAAU,iBAAiB,QAAQ,MAAM,EAAE,mBAAmB,cAAc,CAAC;EACnF,MAAM,cAAc,iBAAiB,QAAQ,MAAM,EAAE,mBAAmB,SAAS,CAAC;EAClF,MAAM,aAAa,iBAAiB,QAAQ,MAAM,EAAE,mBAAmB,QAAQ,CAAC;AAChF,UAAQ,KAAK,uBAAuB,UAAU;AAC9C,UAAQ,KAAK,uBAAuB,UAAU;AAC9C,UAAQ,KAAK,6BAA6B,cAAc;AACxD,UAAQ,KAAK,kBAAkB,aAAa;;AAE9C,SAAQ,IAAI,GAAG;AAGf,SAAQ,KAAK,sDAAsD;AACnE,SAAQ,IAAI,GAAG;AACf,SAAQ,MAAM,mBAAmB;AACjC,SAAQ,IAAI,oCAAoC;AAChD,SAAQ,IAAI,2DAA2D;AACvE,SAAQ,IAAI,iCAAiC;AAC7C,SAAQ,IAAI,8BAA8B;AAC1C,SAAQ,IAAI,+BAA+B;AAC3C,SAAQ,IAAI,4CAA4C;AACxD,SAAQ,IAAI,oDAAoD;AAChE,SAAQ,IAAI,+DAA+D;AAC3E,SAAQ,IAAI,GAAG;AAEf,QAAO;;AAIT,MAAM,WAAW,uBADD,QAAQ,KAAK,SAAS,YAAY,IAAI,QAAQ,KAAK,SAAS,KAAK,CACjC;AAChD,QAAQ,KAAK,SAAS"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../node_modules/oxfmt/configuration_schema.json",
|
|
3
|
+
"tabWidth": 2,
|
|
4
|
+
"printWidth": 120,
|
|
5
|
+
"useTabs": false,
|
|
6
|
+
"semi": true,
|
|
7
|
+
"trailingComma": "all",
|
|
8
|
+
"arrowParens": "always",
|
|
9
|
+
"singleQuote": false,
|
|
10
|
+
"bracketSpacing": true,
|
|
11
|
+
"endOfLine": "lf",
|
|
12
|
+
"ignorePatterns": [],
|
|
13
|
+
"experimentalSortImports": {
|
|
14
|
+
"groups": [
|
|
15
|
+
[
|
|
16
|
+
"side-effect"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"builtin"
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"external",
|
|
23
|
+
"type-external"
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"internal",
|
|
27
|
+
"type-internal"
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"parent",
|
|
31
|
+
"type-parent"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"sibling",
|
|
35
|
+
"type-sibling"
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"index",
|
|
39
|
+
"type-index"
|
|
40
|
+
]
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conorroberts/utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.92",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,9 +24,16 @@
|
|
|
24
24
|
"./oxlint/config": {
|
|
25
25
|
"default": "./dist/oxlint/config.mjson"
|
|
26
26
|
},
|
|
27
|
+
"./oxfmt/config": {
|
|
28
|
+
"default": "./dist/oxfmt/config.json"
|
|
29
|
+
},
|
|
27
30
|
"./oxlint": {
|
|
28
31
|
"types": "./dist/oxlint/index.d.mts",
|
|
29
32
|
"default": "./dist/oxlint/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./db": {
|
|
35
|
+
"types": "./dist/db/index.d.mts",
|
|
36
|
+
"default": "./dist/db/index.mjs"
|
|
30
37
|
}
|
|
31
38
|
},
|
|
32
39
|
"dependencies": {
|
|
@@ -49,6 +56,8 @@
|
|
|
49
56
|
"vitest": "4.0.15"
|
|
50
57
|
},
|
|
51
58
|
"peerDependencies": {
|
|
59
|
+
"consola": ">=3.0.0",
|
|
60
|
+
"drizzle-orm": ">=0.44.0",
|
|
52
61
|
"react": ">=18.0.0",
|
|
53
62
|
"react-dom": ">=18.0.0"
|
|
54
63
|
},
|