Documentation
¶
Overview ¶
Package dbinterface provides database interfaces to avoid import cycles. This package has no dependencies and can be imported by both database implementations and models/stores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Querier ¶
type Querier interface {
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
}
Querier is the centralized interface for database operations. It is implemented by *sql.DB, *sql.Tx, and *database.DB. This allows stores and repositories to accept any of these types and enables transaction support without code duplication.
Click to show internal directories.
Click to hide internal directories.