This commit is contained in:
Benjamin Toby
2025-04-17 12:07:46 +01:00
parent 7c04884a00
commit fb0bc4b753
3 changed files with 15 additions and 3 deletions
@@ -60,12 +60,19 @@ export default function dbSchemaToType(params?: Params): string[] | undefined {
} as DSQL_TableSchemaType;
});
const defDbName = (
datasquirelSchema.dbName ||
datasquirelSchema.dbFullName?.replace(/datasquirel_user_\d+_/, "")
)
.toUpperCase()
.replace(/ /g, "_");
const schemas = dbTablesSchemas
.map((table) =>
generateTypeDefinition({
paradigm: "TypeScript",
table,
typeDefName: `DSQL_DATASQUIREL_${table.tableName.toUpperCase()}`,
typeDefName: `DSQL_${defDbName}_${table.tableName.toUpperCase()}`,
allValuesOptional: true,
addExport: true,
})