- Updated kanel.config.js to use makePgTsGenerator and adjusted type filtering. - Modified various schema files to remove autogenerated comments and updated type definitions for enums to use union types. - Added new MessagesAttachments schema and integrated it into PublicSchema. - Ensured consistency in export types across all schema files.
29 lines
731 B
JavaScript
29 lines
731 B
JavaScript
const { makeKyselyHook } = require("kanel-kysely");
|
|
const { makePgTsGenerator } = require("kanel");
|
|
const ignoredTables = ["schema_migrations"];
|
|
|
|
/** @type {import('kanel').Config} */
|
|
module.exports = {
|
|
connection: {
|
|
host: "localhost",
|
|
user: "postgres",
|
|
database: "postgres",
|
|
password: "rootpost",
|
|
port: 5433,
|
|
},
|
|
filter: (pgTable) => !ignoredTables.includes(pgTable.name),
|
|
outputPath: "./src/schemas",
|
|
generators: [makePgTsGenerator({
|
|
customTypeMap: {
|
|
"pg_catalog.tsvector": "string",
|
|
"pg_catalog.bpchar": "string",
|
|
'pg_catalog.numeric': 'number',
|
|
//"pg_catalog.json": "string",
|
|
},
|
|
preRenderHooks: [makeKyselyHook()],
|
|
|
|
}),
|
|
],
|
|
|
|
preDeleteOutputFolder: true,
|
|
};
|