Claudius Corp uses SQLite with WAL mode. The database is at %APPDATA%\Claudius Corp\database\dmsi.db (installed) or data\dmsi.db (portable).
Schema Migrations #
Migrations are in app/src/main/resources/migrations/V001–V033*.sql. Applied automatically on startup.
To add a migration:
- Create
V034__your_description.sqlin the migrations folder - Write idempotent SQL (use
IF NOT EXISTS,ALTER TABLE ... ADD COLUMN IF NOT EXISTS) - Register the new version in
SchemaVersionRepository
Key Tables #
products — Product catalog with folder paths and metadata.
projects — All projects with status and automation flags.
project_phases — Workflow phases: name, type, role, status, instructions, acceptance criteria.
project_connections — Connections between phases: from/to phase IDs, connection type.
project_documents — Documents produced by phases: name, path, type (deliverable/reference/template/output).
agents — Agent process records: PID, status, timestamps, model.
agent_costs — API cost tracking per agent: model, input tokens, output tokens, cost in USD.
workflow_definitions — Reusable workflow templates.
workflow_phases — Phase templates within workflow definitions.
settings — Key-value configuration store.
learnings — AI agent learning records by product and tags.
escalations — Escalation records with status and resolution timestamps.
approvals — Human approval requests and decisions.
heartbeats — Agent liveness records: agentId, timestamp, message.
notifications — In-app notification queue.
backlog_items — Product backlog items.
board_items — Kanban board task entries.
calendar_events — Calendar events linked to projects and phases.
Database Access Pattern #
DatabaseConnection is a static utility class. Call getConnection() directly:
try (Connection conn = DatabaseConnection.getConnection()) {
PreparedStatement stmt = conn.prepareStatement("SELECT ...");
ResultSet rs = stmt.executeQuery();
// process results
}
Note: The connection uses a proxy that keeps the underlying connection alive.
close()in try-with-resources is safe — it does not actually close the connection.
