Documentation
¶
Overview ¶
Package reader adapts Devin CLI's internal SQLite schema to model types.
It isolates schema-specific SQL/JSON parsing so that reports and UI never touch the raw DB. When Devin CLI changes its schema, only this package needs a new adapter (e.g. v2.go) selected by DetectSchemaVersion.
Index ¶
Constants ¶
const MaxSupportedSchema = 999 // current schema has no version row; treat as v1
MaxSupportedSchema is the highest refinery schema version we understand. Bump when a new adapter is added.
Variables ¶
This section is empty.
Functions ¶
func DetectSchemaVersion ¶
DetectSchemaVersion reads refinery_schema_history max(version). Returns 0 if the table is empty or missing (treated as v1 baseline).
func ResolveDBPath ¶
ResolveDBPath finds sessions.db across platforms.
Order: dataDir arg > DEVIN_DATA_DIR env > platform defaults.
func SortedToolNames ¶
SortedToolNames returns tool names sorted by count desc, for stable display.
Types ¶
type ErrNoDB ¶
type ErrNoDB struct{ Path string }
ErrNoDB is returned when sessions.db cannot be located.
type ErrSchemaUnsupported ¶
type ErrSchemaUnsupported struct{ Ver, Max int }
ErrSchemaUnsupported is returned when the schema version exceeds our adapters.
func (*ErrSchemaUnsupported) Error ¶
func (e *ErrSchemaUnsupported) Error() string
type Reader ¶
type Reader interface {
// Sessions returns all sessions (newest first), with messages aggregated.
Sessions() ([]model.Session, error)
// Session returns a single session by ID, with messages.
Session(id string) (*model.Session, error)
// SchemaVersion returns the detected refinery schema version (0 if none).
SchemaVersion() int
// DBPath returns the resolved database path.
DBPath() string
// Close releases any resources.
Close() error
}
Reader reads normalized data from Devin CLI's session store.