refactor: update database type declaration to use a centralized Database type for improved clarity and consistency

This commit is contained in:
Mauricio Siu
2026-02-24 22:41:54 -06:00
parent d29de8fcba
commit 66ef8a0a5f
+4 -2
View File
@@ -7,11 +7,13 @@ import * as schema from "./schema";
export { and, eq }; export { and, eq };
export * from "./schema"; export * from "./schema";
type Database = PostgresJsDatabase<typeof schema>;
declare global { declare global {
var db: PostgresJsDatabase<typeof schema> | undefined; var db: Database | undefined;
} }
export let db: PostgresJsDatabase<typeof schema>; export let db: Database;
if (process.env.NODE_ENV === "production") { if (process.env.NODE_ENV === "production") {
db = drizzle(postgres(dbUrl), { db = drizzle(postgres(dbUrl), {
schema, schema,