© 2026 Hedgehog Software, LLC
connection.ts
const connectionString = serverEnv.SUPABASE_DATABASE_URL; const pool = postgres(connectionString, { max: 1 }); export const connection = pool; export const db: PostgresJsDatabase<typeof schema> = drizzle(pool, { schema }); (async () => { try { const result = await pool` SELECT current_user, session_user, inet_client_addr(), rolname, rolsuper, rolreplication, rolbypassrls FROM pg_roles WHERE rolname = current_user; `; console.log("DB connection user info:", result[0]); } catch (err) { console.error("Failed to query user info:", err); } })();
current_user: 'postgres', rolname: 'postgres', rolbypassrls: true