fix(db): dialect helpers dispatch on the platform; lint gate for the repository layer

This commit is contained in:
jubnl
2026-09-21 18:12:07 +02:00
parent d7c7afea1b
commit f4fe27a3f8
8 changed files with 197 additions and 48 deletions
+2 -2
View File
@@ -56,8 +56,8 @@ export async function runSchemaBootstrap(orm: AnyOrm): Promise<void> {
export function attachOrm(orm: AnyOrm): void {
registerReinitializeHook(async () => {
const connection = orm.em.getConnection();
// The old handle is already closed by this point; better-sqlite3's close()
// is idempotent, so letting Kysely destroy it again is harmless.
// The handle is owned and closed by `database.ts`; the bound driver's
// `destroy()` is a no-op (see `orm-driver.ts`), so this close never reaches it.
await connection.close(true);
await connection.connect();
await runSchemaBootstrap(orm);