mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
refactor: rename db variable to dbConnection for improved clarity and export the connection for consistent usage across the application
This commit is contained in:
@@ -13,9 +13,9 @@ declare global {
|
||||
var db: Database | undefined;
|
||||
}
|
||||
|
||||
export let db: Database;
|
||||
let dbConnection: Database;
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
db = drizzle(postgres(dbUrl), {
|
||||
dbConnection = drizzle(postgres(dbUrl), {
|
||||
schema,
|
||||
});
|
||||
} else {
|
||||
@@ -24,7 +24,9 @@ if (process.env.NODE_ENV === "production") {
|
||||
schema,
|
||||
});
|
||||
|
||||
db = global.db;
|
||||
dbConnection = global.db;
|
||||
}
|
||||
|
||||
export const db: Database = dbConnection;
|
||||
|
||||
export { dbUrl };
|
||||
|
||||
Reference in New Issue
Block a user