Overview of the ccflare Database Layer
mainccflare uses SQLite as its exclusive runtime datastore, utilizing Bun's native SQLite bindings. The database layer is responsible for managing configured accounts, request summaries, full request/response payload documents, and short-lived OAuth authentication sessions.
Key architectural components include:
- Repository Pattern: Each domain (Accounts, Requests, etc.) has a dedicated repository that owns its SQL and maps rows to application shapes.
- Async Write Queue: An
AsyncDbWriterhandles background persistence to prevent blocking request forwarding. - Migration System: A normalization-oriented system that ensures schema consistency and upgrades older layouts to the current runtime model.