Major Bugfix

This commit is contained in:
Benjamin Toby 2026-03-22 05:44:28 +01:00
parent 04e4e0e9fd
commit f0cec49e3b
3 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,9 @@ export default function dbSchemaToType({ config, dbSchema, }) {
.map((tbl) => ` "${tbl.tableName}",`) .map((tbl) => ` "${tbl.tableName}",`)
.join("\n")}\n] as const`; .join("\n")}\n] as const`;
const dbTablesSchemas = datasquirelSchema.tables; const dbTablesSchemas = datasquirelSchema.tables;
const defDbName = config.db_name?.toUpperCase().replace(/ |\-/g, "_"); const defDbName = config.db_name
?.toUpperCase()
.replace(/^[a-zA-Z0-9]/g, "_");
const defNames = []; const defNames = [];
const schemas = dbTablesSchemas const schemas = dbTablesSchemas
.map((table) => { .map((table) => {

View File

@ -1,6 +1,6 @@
{ {
"name": "@moduletrace/bun-sqlite", "name": "@moduletrace/bun-sqlite",
"version": "1.0.10", "version": "1.0.11",
"description": "SQLite manager for Bun", "description": "SQLite manager for Bun",
"author": "Benjamin Toby", "author": "Benjamin Toby",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -24,7 +24,9 @@ export default function dbSchemaToType({
const dbTablesSchemas = datasquirelSchema.tables; const dbTablesSchemas = datasquirelSchema.tables;
const defDbName = config.db_name?.toUpperCase().replace(/ |\-/g, "_"); const defDbName = config.db_name
?.toUpperCase()
.replace(/^[a-zA-Z0-9]/g, "_");
const defNames: string[] = []; const defNames: string[] = [];