Documentation ¶
Index ¶
- Variables
- func Get(ctx context.Context, queryer Queryer, dest interface{}, query string, ...) error
- func ScanFlat(r pgx.Rows, dest interface{}) error
- func ScanStruct(r pgx.Rows, dest interface{}) error
- func ScanStructs(r pgx.Rows, dest interface{}) error
- func Select(ctx context.Context, queryer Queryer, dest interface{}, query string, ...) error
- func SelectFlat(ctx context.Context, queryer Queryer, dest interface{}, query string, ...) error
- type Queryer
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMapper = reflectx.NewMapperFunc("db", sqlx.NameMapper)
Functions ¶
func ScanStruct ¶
ScanStruct scans a pgx.Rows into destination struct passed by reference based on the "db" fields tags. This is workaround function for pgx.Rows with single row as pgx/v4 does not allow to get row metadata from pgx.Row - see https://github.com/jackc/pgx/issues/627 for details.
If there are no rows pgx.ErrNoRows is returned. If there are more than one row in the result - they are ignored. Function call closes rows, so caller may skip it.
func ScanStructs ¶
ScanStructs scans a pgx.Rows into destination structs list passed by reference based on the "db" fields tags
Types ¶
Click to show internal directories.
Click to hide internal directories.