2025-08-04 17:45:44 +02:00
|
|
|
const { makeKyselyHook } = require("kanel-kysely");
|
2026-04-27 16:53:54 +02:00
|
|
|
const { makePgTsGenerator } = require("kanel");
|
2025-10-29 17:57:59 +01:00
|
|
|
const ignoredTables = ["schema_migrations"];
|
2025-08-04 17:45:44 +02:00
|
|
|
|
|
|
|
|
/** @type {import('kanel').Config} */
|
|
|
|
|
module.exports = {
|
|
|
|
|
connection: {
|
|
|
|
|
host: "localhost",
|
|
|
|
|
user: "postgres",
|
|
|
|
|
database: "postgres",
|
|
|
|
|
password: "rootpost",
|
2025-10-29 17:57:59 +01:00
|
|
|
port: 5433,
|
2025-08-04 17:45:44 +02:00
|
|
|
},
|
2026-04-27 16:53:54 +02:00
|
|
|
filter: (pgTable) => !ignoredTables.includes(pgTable.name),
|
2025-08-04 17:45:44 +02:00
|
|
|
outputPath: "./src/schemas",
|
2026-04-27 16:53:54 +02:00
|
|
|
generators: [makePgTsGenerator({
|
|
|
|
|
customTypeMap: {
|
|
|
|
|
"pg_catalog.tsvector": "string",
|
|
|
|
|
"pg_catalog.bpchar": "string",
|
|
|
|
|
'pg_catalog.numeric': 'number',
|
|
|
|
|
//"pg_catalog.json": "string",
|
|
|
|
|
},
|
|
|
|
|
preRenderHooks: [makeKyselyHook()],
|
2025-08-04 17:45:44 +02:00
|
|
|
|
2026-04-27 16:53:54 +02:00
|
|
|
}),
|
|
|
|
|
],
|
2025-11-25 12:05:14 +01:00
|
|
|
|
2026-04-27 16:53:54 +02:00
|
|
|
preDeleteOutputFolder: true,
|
2025-08-04 17:45:44 +02:00
|
|
|
};
|