sqlite

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(db *sql.DB) error

Close closes the database connection gracefully.

func GetMigrationStatus

func GetMigrationStatus(db *sql.DB) (int64, error)

GetMigrationStatus returns the current migration version.

func NewConnection

func NewConnection(ctx context.Context, dbPath string) (*sql.DB, error)

NewConnection creates a new SQLite database connection with optimized settings. It creates the database directory if it doesn't exist and applies performance pragmas.

func NewContentWhitelistRepository

func NewContentWhitelistRepository(db *sql.DB) repository.ContentWhitelistRepository

NewContentWhitelistRepository creates a new SQLite-backed content whitelist repository.

func NewFavoriteRepository

func NewFavoriteRepository(db *sql.DB) repository.FavoriteRepository

NewFavoriteRepository creates a new SQLite-backed favorite repository.

func NewFolderRepository

func NewFolderRepository(db *sql.DB) repository.FolderRepository

NewFolderRepository creates a new SQLite-backed folder repository.

func NewHistoryRepository

func NewHistoryRepository(db *sql.DB) repository.HistoryRepository

NewHistoryRepository creates a new SQLite-backed history repository.

func NewSessionRepository

func NewSessionRepository(db *sql.DB) repository.SessionRepository

func NewSessionStateRepository added in v0.21.0

func NewSessionStateRepository(db *sql.DB) repository.SessionStateRepository

NewSessionStateRepository creates a new session state repository.

func NewTagRepository

func NewTagRepository(db *sql.DB) repository.TagRepository

NewTagRepository creates a new SQLite-backed tag repository.

func NewZoomRepository

func NewZoomRepository(db *sql.DB) repository.ZoomRepository

NewZoomRepository creates a new SQLite-backed zoom repository.

func RunMigrations

func RunMigrations(ctx context.Context, db *sql.DB) error

RunMigrations applies all pending migrations to the database. Uses goose with embedded SQL files for automatic schema management.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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