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 ¶
Transactor provides transaction management.
func NewTransactor ¶
func NewTransactor(db *sql.DB) Transactor
Click to show internal directories.
Click to hide internal directories.