sqlite

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package sqlite reads Cline's session index, sessions.db: its sessions table, which alone records which agent spawned a sub-agent, yielding its rows as the clinesdk package's. It reads a private copy of the database and its write-ahead log, never the database in place (internal/sqlite), so it neither writes beside a database Cline holds open in WAL mode nor waits on its locks. It is one of the packages of this module that import a database driver, as clinesdk/convert does not: it takes OpenIndex in its Options.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotCline = errors.New("the database has no sessions table of Cline's")

ErrNotCline is returned by Open for a database without Cline's sessions table.

View Source
var Fixture = isqlite.Fixture

Fixture builds a database at path from SQL text, for tests.

Functions

func OpenIndex

func OpenIndex(path string) (clinesdk.Index, error)

OpenIndex is Open as clinesdk/convert takes it, in its Options.OpenIndex.

func RemoveCopies

func RemoveCopies()

RemoveCopies removes the copy of every database open, for a program interrupted while it reads one.

Types

type DB

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

DB is a copy of sessions.db, open for reading. It implements clinesdk.Index. A DB is not safe for concurrent use.

func Open

func Open(path string) (*DB, error)

Open copies the database at path and opens the copy. Close removes it.

func (*DB) Close

func (d *DB) Close() error

Close closes the copy and removes it.

func (*DB) Family

func (d *DB) Family(root string) ([]*clinesdk.Row, error)

Family returns the rows of root and of every session whose parent is root or whose ID starts with root and "__".

func (*DB) Name

func (d *DB) Name() string

Name is the database's file name.

Jump to

Keyboard shortcuts

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