use bun sql instead of postgres.js

This commit is contained in:
2026-03-12 23:40:44 +01:00
parent aaef31254b
commit be19e26d1b
10 changed files with 31 additions and 41 deletions

View File

@@ -11,8 +11,7 @@
* then run this script to populate them.
*/
import postgres from 'postgres';
import { S3Client } from 'bun';
import { SQL, S3Client } from 'bun';
// ── Config ─────────────────────────────────────────────────────────────
@@ -130,7 +129,7 @@ async function getBeatmap(beatmapId: string): Promise<BeatmapData | null> {
// ── Main ───────────────────────────────────────────────────────────────
const sql = postgres(DATABASE_URL);
const sql = new SQL(DATABASE_URL);
// ════════════════════════════════════════════════════════════════════════
// 1. MAPPOOL SLOTS — backfill title/artist/version/coverUrl/listCoverUrl
@@ -263,4 +262,4 @@ console.log(` Mappool slots: ${slotOk} backfilled, ${slotFail} failed`);
console.log(` User avatars: ${avatarOk} re-proxied, ${avatarSkip} already R2`);
console.log(` Team avatars: ${teamOk} re-proxied, ${teamSkip} already R2`);
await sql.end();
await sql.close();