mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-12 23:15:18 +00:00
refactor: update database type declaration to use a centralized Database type for improved clarity and consistency
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user