Development and Roadmap
Build
# Debug buildmake build
# Release build (optimized, stripped)make build-release
# Install to ~/.local/bin or GOPATHmake installTest
# Run all testsmake test
# Verbose outputmake test-vLint & Format
# Format codemake fmt
# Run linter (requires golangci-lint)make lint
# Check for issuesgo vet ./...Code Conventions
- TUI: Bubble Tea for model/update, lipgloss for styling
- Database: All DB operations through the
Storestruct (internal/store) - Error handling: Return
error, wrap with context viafmt.Errorf - Tests: Table-driven tests
- Cancellation: Context-based cancellation for long operations
- Encoding: Charset detection via
gogs/chardet, conversion viagolang.org/x/text/encoding
SQL Guidelines
- Never use
SELECT DISTINCTwith JOINs: useEXISTSsubqueries instead (semi-joins) EXISTSis faster (stops at first match) and avoids duplicates at the source
Instead of:
SELECT DISTINCT m.id FROM messages mJOIN message_recipients mr ON mr.message_id = m.idWHERE mr.recipient_type = 'from' AND ...Use:
SELECT m.id FROM messages mWHERE EXISTS ( SELECT 1 FROM message_recipients mr WHERE mr.message_id = m.id AND mr.recipient_type = 'from' AND ...)Dependencies
| Library | Purpose |
|---|---|
cobra | CLI framework |
charmbracelet/bubbletea | TUI framework |
charmbracelet/lipgloss | TUI styling |
mattn/go-sqlite3 | SQLite with CGO (FTS5) |
marcboeker/go-duckdb | DuckDB driver for Parquet |
gogs/chardet | Character set detection |
golang.org/x/text | Text encoding conversion |