store

package
v0.13.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryInterceptor

type QueryInterceptor interface {
	QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
	QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
	ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
}

QueryInterceptor provides database query methods with transaction awareness. Implementations route queries through an active transaction if present in context.

NOTE: The default implementation (queryInterceptor) is DuckDB-specific. It uses: - Mutex serialization in ExecContext to satisfy DuckDB's single-connection constraint - FORCE CHECKPOINT after non-transactional writes to flush DuckDB's WAL to the main file

If supporting other databases, a separate implementation would be needed without these DuckDB-specific behaviors.

func NewQueryInterceptor

func NewQueryInterceptor(db *sql.DB) QueryInterceptor

type Transactor

type Transactor interface {
	WithTx(ctx context.Context, fn func(ctx context.Context) error) error
}

Transactor provides transaction management.

func NewTransactor

func NewTransactor(db *sql.DB) Transactor

Jump to

Keyboard shortcuts

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