feat: Multi-Database Support (SQLite + PostgreSQL) #262
Labels
No labels
good first issue
has-pr
help wanted
idea
priority
critical
priority
high
priority
low
priority
medium
status
blocked
status
in-progress
status
needs-review
status
ready
type
bug
type
docs
type
enhancement
type
feature
type
refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
customable/claude-mem#262
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
better-sqlite3erfordert native Compilation, was bei der NPM-Distribution Probleme verursachen kann:Außerdem ist SQLite nicht für Multi-User/Remote-Szenarien geeignet.
Lösung
Hybrid-Ansatz: SQLite als Default, PostgreSQL als Option für Power-User/SaaS.
Aufgaben
Phase 1: SQLite-Probleme lösen
prebuild-installfür prebuilt binaries konfigurierenPhase 2: PostgreSQL-Support
Phase 3: Optional - libSQL evaluieren
Akzeptanzkriterien
pnpm installfunktioniert ohne Build-Tools (prebuilt binaries)DATABASE_URLEnvironment-Variable aktiviert werdenTechnische Details
MikroORM unterstützt bereits beide Datenbanken. Änderungen hauptsächlich in:
packages/database/src/mikro-orm.config.tspackages/shared/src/settings.tsVerwandte Issues
discussion: SQLite vs. Alternative Datenbankento feat: Multi-Database Support (SQLite + PostgreSQL)Progress Update: Phase 2 - PostgreSQL CLI Support
Added PostgreSQL connection string support to the CLI:
The connection string is automatically parsed and mapped to settings:
DATABASE_TYPE→postgresDATABASE_HOST→ from URLDATABASE_PORT→ from URL (default: 5432)DATABASE_USER→ from URLDATABASE_PASSWORD→ from URLDATABASE_NAME→ from URL pathExisting Support
The backend already supported PostgreSQL through MikroORM and settings:
CLAUDE_MEM_DATABASE_TYPE=postgresCLAUDE_MEM_DATABASE_HOST,CLAUDE_MEM_DATABASE_PORT, etc.DATABASE_TYPE: 'postgres'Remaining Tasks
Implementation Complete
Phase 1: SQLite Prebuilt Support
better-sqlite3already includesprebuild-install(v11.10.0)docs/DATABASE.mdPhase 2: PostgreSQL Support
mikro-orm.config.ts)--dbflag for PostgreSQL connection stringsDATABASE_URLenvironment variable parsing insettings.tsdocs/DATABASE.mdChanges Made
packages/shared/src/settings.ts
parseDatabaseUrl()method for DATABASE_URL parsingpostgres://andpostgresql://connection stringspackages/backend/src/cli.ts
parseDatabaseOption()for--dbflag--targetwith PostgreSQLdocs/DATABASE.md (new)
README.md
Usage
Commits
f68783dfeat(backend): add PostgreSQL connection string support to CLI (Issue #262)b69f7bbfeat(backend): support PostgreSQL as migration target (Issue #198, #262)31e0317docs: add multi-database documentation and DATABASE_URL support (Issue #262)