db

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

DB wraps a *sql.DB with qi-specific helpers.

func Open

func Open(ctx context.Context, path string) (*DB, error)

Open opens (or creates) the qi SQLite database at path, runs migrations, and configures WAL mode.

func (*DB) DeleteCollection added in v0.4.0

func (db *DB) DeleteCollection(ctx context.Context, name string) error

DeleteCollection removes all data associated with the given collection name: chunk vectors, embeddings, chunks (FTS triggers keep chunks_fts in sync), documents, index runs, and the collections table row. Orphaned content blobs (not referenced by any remaining document) are also pruned.

func (*DB) InsertEmbedding

func (db *DB) InsertEmbedding(ctx context.Context, chunkID int64, embedding []float32) error

InsertEmbedding stores a vector embedding for a chunk as a raw BLOB.

func (*DB) Ping

func (db *DB) Ping(ctx context.Context) error

Ping verifies the database connection.

Jump to

Keyboard shortcuts

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