mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 20:42:25 -05:00
[chore]: Bump github.com/jackc/pgx/v5 from 5.4.2 to 5.4.3 (#2112)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
parent
5a4ceebcbd
commit
e70629e856
15 changed files with 191 additions and 190 deletions
13
vendor/github.com/jackc/pgx/v5/rows.go
generated
vendored
13
vendor/github.com/jackc/pgx/v5/rows.go
generated
vendored
|
|
@ -306,7 +306,7 @@ func (rows *baseRows) Values() ([]any, error) {
|
|||
copy(newBuf, buf)
|
||||
values = append(values, newBuf)
|
||||
default:
|
||||
rows.fatal(errors.New("Unknown format code"))
|
||||
rows.fatal(errors.New("unknown format code"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -496,7 +496,8 @@ func (rs *mapRowScanner) ScanRow(rows Rows) error {
|
|||
}
|
||||
|
||||
// RowToStructByPos returns a T scanned from row. T must be a struct. T must have the same number a public fields as row
|
||||
// has fields. The row and T fields will by matched by position.
|
||||
// has fields. The row and T fields will by matched by position. If the "db" struct tag is "-" then the field will be
|
||||
// ignored.
|
||||
func RowToStructByPos[T any](row CollectableRow) (T, error) {
|
||||
var value T
|
||||
err := row.Scan(&positionalStructRowScanner{ptrToStruct: &value})
|
||||
|
|
@ -504,7 +505,8 @@ func RowToStructByPos[T any](row CollectableRow) (T, error) {
|
|||
}
|
||||
|
||||
// RowToAddrOfStructByPos returns the address of a T scanned from row. T must be a struct. T must have the same number a
|
||||
// public fields as row has fields. The row and T fields will by matched by position.
|
||||
// public fields as row has fields. The row and T fields will by matched by position. If the "db" struct tag is "-" then
|
||||
// the field will be ignored.
|
||||
func RowToAddrOfStructByPos[T any](row CollectableRow) (*T, error) {
|
||||
var value T
|
||||
err := row.Scan(&positionalStructRowScanner{ptrToStruct: &value})
|
||||
|
|
@ -545,6 +547,11 @@ func (rs *positionalStructRowScanner) appendScanTargets(dstElemValue reflect.Val
|
|||
if sf.Anonymous && sf.Type.Kind() == reflect.Struct {
|
||||
scanTargets = rs.appendScanTargets(dstElemValue.Field(i), scanTargets)
|
||||
} else if sf.PkgPath == "" {
|
||||
dbTag, _ := sf.Tag.Lookup(structTagKey)
|
||||
if dbTag == "-" {
|
||||
// Field is ignored, skip it.
|
||||
continue
|
||||
}
|
||||
scanTargets = append(scanTargets, dstElemValue.Field(i).Addr().Interface())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue