schema

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentVersion = 24

CurrentVersion is the current schema version.

Variables

This section is empty.

Functions

func BackfillEventID

func BackfillEventID(thrumDir string) error

BackfillEventID backfills event_id fields for events in JSONL files that lack them. This is part of the v6→v7 migration. It generates deterministic event IDs based on the event's type, timestamp, and entity ID (message_id, thread_id, etc.). The deterministic generation ensures that running this migration multiple times produces the same event_ids. Works with both sharded and monolithic file structures.

func ExtractAgentName

func ExtractAgentName(agentID string) string

ExtractAgentName extracts the agent name from an agent_id. Example: "agent:coordinator:1B9K" → "coordinator_1B9K".

func GetSchemaVersion

func GetSchemaVersion(db *sql.DB) (int, error)

GetSchemaVersion returns the current schema version from the database.

func InitDB

func InitDB(db *sql.DB) error

InitDB initializes a new database with the current schema.

func Migrate

func Migrate(db *sql.DB) error

Migrate migrates the database to the current schema version.

func MigrateJSONLSharding

func MigrateJSONLSharding(thrumDir string) error

MigrateJSONLSharding migrates from monolithic messages.jsonl to sharded structure. This is part of the v6→v7 migration. It splits the monolithic file into: - events.jsonl (non-message events: agent lifecycle, threads) - messages/{author}.jsonl (per-agent message files).

func OpenDB

func OpenDB(path string) (*sql.DB, error)

OpenDB opens a SQLite database connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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