Skip to content

Implement SQLite conversation store with sqlx #17

@bug-ops

Description

@bug-ops

Description

Persistent storage for conversations and messages using SQLite via sqlx.

Parent: #4

Branch

feat/m3/sqlite-memory

Files

  • crates/zeph-memory/src/sqlite.rs — SqliteStore struct
  • crates/zeph-memory/src/lib.rs — exports
  • crates/zeph-memory/Cargo.toml — add sqlx (sqlite, runtime-tokio)
  • migrations/001_init.sql — DDL

Schema

CREATE TABLE conversations (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    created_at TEXT NOT NULL DEFAULT (datetime('now'))
);

CREATE TABLE messages (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    conversation_id INTEGER NOT NULL REFERENCES conversations(id),
    role TEXT NOT NULL,
    content TEXT NOT NULL,
    created_at TEXT NOT NULL DEFAULT (datetime('now'))
);

Acceptance Criteria

  • Creates database file if not exists
  • Migrations run on startup
  • CRUD operations work
  • Unit tests with in-memory SQLite (:memory:)

Metadata

Metadata

Assignees

No one assigned

    Labels

    M3Milestone 3: Memory + ClaudefeatureNew functionalitymemoryPersistence and memory

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions