Database Adapters
Lucent currently supports two adapters:
| Adapter | Status | Notes |
|---|---|---|
| PostgreSQL | Primary path | Recommended for production |
| SurrealDB | Optional path | Test explicitly before production use |
PostgreSQL
import { defineLucentConfig } from "@codesordinatestudio/lucent";
export default defineLucentConfig({
db: {
adapter: "postgres",
url: process.env.DATABASE_URL,
pool: {
max: 10,
},
},
collections: Collections,
});
Environment:
DATABASE_URL=postgresql://user:password@localhost:5432/mydb
SurrealDB
import { defineLucentConfig } from "@codesordinatestudio/lucent";
export default defineLucentConfig({
db: {
adapter: "surrealdb",
url: process.env.SURREAL_URL,
namespace: process.env.SURREAL_NAMESPACE,
database: process.env.SURREAL_DATABASE,
auth: {
username: process.env.SURREAL_USERNAME!,
password: process.env.SURREAL_PASSWORD!,
},
},
collections: Collections,
});
Environment:
SURREAL_URL=ws://localhost:8000
SURREAL_NAMESPACE=lucent
SURREAL_DATABASE=lucent
SURREAL_USERNAME=root
SURREAL_PASSWORD=root
Adapter Notes
- PostgreSQL is the main production target
- SurrealDB support exists, but you should validate your own feature path and migration flow before relying on it in production
- Lucent migrations are adapter-aware, but adapter parity is not the same thing as equal operational maturity
See Migrations for the operator workflow.