Documentation
¶
Index ¶
- func Exec(ctx context.Context, db *sqlx.DB) sqlx.ExtContext
- type DB
- func (d *DB) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (d *DB) GetContext(ctx context.Context, dest any, query string, args ...any) error
- func (d *DB) NamedExecContext(ctx context.Context, query string, arg any) (sql.Result, error)
- func (d *DB) QueryRowxContext(ctx context.Context, query string, args ...any) *sqlx.Row
- func (d *DB) QueryxContext(ctx context.Context, query string, args ...any) (*sqlx.Rows, error)
- func (d *DB) Rebind(query string) string
- func (d *DB) SelectContext(ctx context.Context, dest any, query string, args ...any) error
- func (d *DB) WithinTx(ctx context.Context, fn func(context.Context) error) error
- type DBTime
- type SQLite
- type Transactor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶ added in v0.3.0
type DB struct {
// contains filtered or unexported fields
}
DB is the repo-facing handle. It has the full query surface + WithinTx.
func (*DB) ExecContext ¶ added in v0.3.0
func (*DB) GetContext ¶ added in v0.3.0
func (*DB) NamedExecContext ¶ added in v0.3.0
func (*DB) QueryRowxContext ¶ added in v0.3.0
func (*DB) QueryxContext ¶ added in v0.3.0
func (*DB) Rebind ¶ added in v0.3.0
Rebind translates `?` placeholders to whatever the underlying driver expects. Lets callers compose queries via sqlx.In (e.g. `WHERE id IN (?)`) without having to think about driver-specific bind styles.
func (*DB) SelectContext ¶ added in v0.3.0
type DBTime ¶
DBTime is only needed for aggregate functions (MAX, MIN etc.) that return TEXT even for DATETIME columns. Regular columns declared as DATETIME scan directly into time.Time when using modernc.org/sqlite with _texttotime=1 in the DSN.
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
func (*SQLite) Transactor ¶ added in v0.3.0
func (s *SQLite) Transactor() *Transactor
type Transactor ¶ added in v0.3.0
type Transactor struct {
// contains filtered or unexported fields
}
Transactor is the service-facing handle. It exposes ONLY tx orchestration — no query methods. A service holding one can compose operations atomically but cannot perform SQL.
func NewTransactor ¶ added in v0.3.0
func NewTransactor(pool *sqlx.DB) *Transactor