Add PostgreSQL support via pg and node-postgres drizzle adapter

This commit is contained in:
openhands committed 2026-10-23 19:58:06 +02:00
1 parent 79b0b8894d
commit 9cff32a04b
5 files changed
+2572 -4403

No files matched your search

+5 -2
View File
@@ -6,12 +6,15 @@ import { defineConfig } from "drizzle-kit";
// This DB is shared with the Arcturus emulator — NEVER run `drizzle-kit migrate`
// or `push` against it. CMS DDL stays in drizzle/migrations/*.sql applied by
// `pnpm db:migrate`. Use `pnpm db:generate` only for draft SQL under drizzle/drafts/.
const dbUrl = process.env.DATABASE_URL ?? "";
const isPostgres = dbUrl.startsWith("postgres://") || dbUrl.startsWith("postgresql://");
export default defineConfig({
dialect: "mysql",
dialect: isPostgres ? "postgresql" : "mysql",
schema: "./src/db/schema.ts",
out: "./drizzle/drafts",
dbCredentials: {
url: process.env.DATABASE_URL ?? "",
url: dbUrl,
},
strict: true,
verbose: true,