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

@@ -5,16 +5,14 @@
* Usage: bun scripts/seed-db.ts
*/
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
import { drizzle } from 'drizzle-orm/bun-sql';
import { sql } from 'drizzle-orm';
import { pgTable, text, uuid, boolean, timestamp, integer, real, jsonb } from 'drizzle-orm/pg-core';
const DATABASE_URL = process.env.DATABASE_URL;
if (!DATABASE_URL) throw new Error('DATABASE_URL not set');
const client = postgres(DATABASE_URL);
const db = drizzle(client);
const db = drizzle(DATABASE_URL);
const mappool = pgTable('mappool', {
id: uuid('id').primaryKey().defaultRandom(),