feat: 项目从deno迁移回使用bun

This commit is contained in:
ethan.chen
2026-01-08 14:30:11 +08:00
parent 2b5b2f1d97
commit 02ebb4c648
10 changed files with 101 additions and 152 deletions

View File

@@ -8,12 +8,12 @@ import postgres from "postgres";
// 从环境变量获取数据库连接信息
const DATABASE_URL =
Deno.env.get("DATABASE_URL") ||
`postgresql://${Deno.env.get("DB_USER") || "postgres"}:${
Deno.env.get("DB_PASSWORD") || "postgres"
}@${Deno.env.get("DB_HOST") || "localhost"}:${
Deno.env.get("DB_PORT") || "5432"
}/${Deno.env.get("DB_NAME") || "media"}`;
process.env.DATABASE_URL ||
`postgresql://${process.env.DB_USER || "postgres"}:${
process.env.DB_PASSWORD || "postgres"
}@${process.env.DB_HOST || "localhost"}:${process.env.DB_PORT || "5432"}/${
process.env.DB_NAME || "media"
}`;
// 初始化 PostgreSQL 连接
const sql = postgres(DATABASE_URL);