Skip to main content

Module persistence

Module persistence 

Source
Expand description

Persistence trait — the database contract. Persistence trait — the storage contract for koda.

Types and trait definition for the storage layer. The engine depends on this trait, not the concrete SQLite implementation.

The default implementation is Database in db.rs.

§Design (DESIGN.md)

  • Database Backend: SQLite + Persistence Trait (P3): This trait exists because P3 says the storage backend will change. But there’s only one real implementation because P1 says we don’t need a second one yet. When P1 and P3 conflict: P1 wins on timing, P3 wins on architecture.

Structs§

CompactedStats
Stats about compacted (archived) messages in the database.
Message
A stored message row.
SessionInfo
Summary info for a stored session.
SessionUsage
Token usage totals for a session.

Enums§

InterruptionKind
Detected interruption state for a resumed session.
Role
Message roles in the conversation.

Traits§

Persistence
Core storage contract for sessions, messages, and metadata.