sqlite

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package sqlite is the SQLite driver for Anetos's db package. It uses modernc.org/sqlite, a pure-Go SQLite, so builds need no C compiler and cross-compile to a single binary.

database, err := db.Connect(ctx, app, sqlite.Driver())

DB_DATABASE is the database file (default database/app.db; its directory is created if missing), or :memory: for a private in-memory database. Connections use WAL journaling, a 5 second busy timeout, foreign keys, and transactions that take the write lock when they begin, so concurrent writers wait instead of failing. The driver adds the SQL function vector search compares embeddings with (db.SQLiteCosineFunction). DB_URL replaces all of this with a modernc.org/sqlite DSN of your own.

Index

Constants

View Source
const DefaultPath = "database/app.db"

DefaultPath is the database file used when DB_DATABASE is empty.

Variables

This section is empty.

Functions

func DSN

func DSN(cfg db.Config) string

DSN returns the modernc.org/sqlite connection string for cfg.

func Driver

func Driver() db.Driver

Driver returns the SQLite driver, selected by DB_CONNECTION=sqlite.

Types

This section is empty.

Jump to

Keyboard shortcuts

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