db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package db handles database operations including schema management and migrations.

Index

Constants

View Source
const CreateChunkEmbeddingsTable = `` /* 126-byte string literal not displayed */
View Source
const CreateChunksTable = `` /* 361-byte string literal not displayed */
View Source
const CreateIndexChunksRepoID = `CREATE INDEX IF NOT EXISTS idx_chunks_repo_id ON chunks(repo_id)`
View Source
const CreateIndexRepoEmbeddedHash = `CREATE INDEX IF NOT EXISTS idx_repos_embedded_hash ON repos(embedded_hash)`
View Source
const CreateIndexRepoPushedAtHash = `CREATE INDEX IF NOT EXISTS idx_repos_pushed_at_hash ON repos(pushed_at_hash)`
View Source
const CreateIndexReposFullName = `CREATE INDEX IF NOT EXISTS idx_repos_full_name ON repos(full_name)`

Index definitions

View Source
const CreateIndexReposGitHubID = `CREATE INDEX IF NOT EXISTS idx_repos_github_id ON repos(github_id)`
View Source
const CreateIndexReposIsStarred = `CREATE INDEX IF NOT EXISTS idx_repos_is_starred ON repos(is_starred)`
View Source
const CreateIndexReposLanguage = `CREATE INDEX IF NOT EXISTS idx_repos_language ON repos(language)`
View Source
const CreateReposTable = `` /* 781-byte string literal not displayed */
View Source
const CreateSyncStateTable = `` /* 317-byte string literal not displayed */

Variables

This section is empty.

Functions

func Close

func Close(db *sql.DB) error

Close closes the database connection.

func IsWALEnabled

func IsWALEnabled(db *sql.DB) (bool, error)

IsWALEnabled checks if WAL mode is enabled for the database.

func Open

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

Open opens (or creates) the SQLite database at the given path, applies all pragmas, loads the sqlite-vec extension, and runs schema migrations. The caller is responsible for calling Close().

func RunMigrations

func RunMigrations(db *sql.DB) error

RunMigrations runs all schema migrations. Each statement is idempotent (IF NOT EXISTS) so running migrations multiple times is safe.

func VecVersion

func VecVersion(db *sql.DB) (string, error)

VecVersion returns the sqlite-vec version to verify it's loaded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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