Storage & Portability
Wakeplane is SQLite-first. Postgres support is planned at the storage seam.
Current state
Section titled “Current state”All production use runs on SQLite via modernc.org/sqlite (pure Go, no CGO).
| Aspect | Status |
|---|---|
| Driver | modernc.org/sqlite (pure Go) |
| Connection | Single writer (SetMaxOpenConns(1)) |
| Migrations | Embedded via golang-migrate |
| Timestamps | TEXT / RFC3339Nano |
| Booleans | INTEGER 0/1 |
| JSON | TEXT |
| Upserts | INSERT OR REPLACE |
What is already portable
Section titled “What is already portable”- All application logic (scheduler, dispatcher, executors)
- Schema structure (table names, columns, relationships)
- ID generation (UUIDs, deterministic occurrence keys)
- Cursor-based pagination logic
- Transaction patterns
What must change for Postgres
Section titled “What must change for Postgres”| Change | Effort |
|---|---|
Driver and Open() signature | Low |
INSERT OR REPLACE → INSERT ... ON CONFLICT DO UPDATE | Low |
julianday() date arithmetic → INTERVAL expressions | Low |
Timestamp column types TEXT → TIMESTAMPTZ | Medium (migration) |
Boolean column types INTEGER → BOOLEAN | Medium (migration) |
| Error detection (string matching → pq error codes) | Low |
Estimated scope: ~200 lines in store.go plus migration files.
Storage interface
Section titled “Storage interface”The store implements a typed interface covering:
- Lifecycle (open, migrate, close)
- Schedule CRUD and pagination
- Run CRUD, state transitions, pagination
- Claim and lease operations
- Overlap query (concurrent run detection)
- Metrics and status counts
- Receipt storage
The interface is designed to accommodate a Postgres dialect without changing application code.
See also
Section titled “See also”- Reference: Embedding — using Wakeplane as a Go library
docs/storage-interface.mdin the source repodocs/sqlite-audit.mdin the source repo