feat: database layer - PostgreSQL schema + memory fallback
Some checks failed
CI / lint-and-typecheck (push) Failing after 16m21s
CI / test (push) Has been skipped
CI / build (push) Has been skipped

- drizzle-orm + postgres dependencies
- Full schema: 12 tables covering all modules
- Graceful fallback: no DATABASE_URL → memory mode
- drizzle-kit config for migrations
- Memory store as generic CRUD layer
- dev.ts auto-initializes DB on startup
This commit is contained in:
xiaohei
2026-04-12 19:05:03 +08:00
parent 2532cf4f4e
commit 15a70e4ecf
7 changed files with 477 additions and 1 deletions

10
drizzle.config.ts Normal file
View File

@@ -0,0 +1,10 @@
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
schema: './src/db/schema.ts',
out: './drizzle',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL || 'postgresql://flowpilot:flowpilot@localhost:5432/flowpilot',
},
});