store

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBPath

func DBPath() (string, error)

DBPath returns the path to the database file

Types

type Entry

type Entry struct {
	ID              int64
	Persona         string
	Content         string
	CreatedAt       time.Time
	ModelID         string
	MessageID       string
	MetricsSnapshot *metrics.Snapshot
}

Entry represents a saved journal entry

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store handles persistence of journal entries

func Open

func Open() (*Store, error)

Open creates or opens the database

func (*Store) Close

func (s *Store) Close() error

Close closes the database connection

func (*Store) CountByPersona added in v0.0.5

func (s *Store) CountByPersona(persona string) (int, error)

CountByPersona returns the number of entries for a specific persona

func (*Store) DeleteAll added in v0.0.5

func (s *Store) DeleteAll() (int64, error)

DeleteAll removes all entries from the database

func (*Store) DeleteByPersona added in v0.0.5

func (s *Store) DeleteByPersona(persona string) (int64, error)

DeleteByPersona removes all entries for a specific persona

func (*Store) GetByID

func (s *Store) GetByID(id int64) (*Entry, error)

GetByID retrieves a single entry by ID

func (*Store) List

func (s *Store) List(limit int) ([]*Entry, error)

List retrieves entries with optional limit, newest first

func (*Store) ListByPersona

func (s *Store) ListByPersona(persona string, limit int) ([]*Entry, error)

ListByPersona retrieves entries for a specific persona

func (*Store) Save

func (s *Store) Save(persona string, content string, modelID string, messageID string, snapshot *metrics.Snapshot) (*Entry, error)

Save persists a new journal entry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL