mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 04:53:00 -06:00
[chore]: Bump github.com/jackc/pgx/v5 from 5.7.2 to 5.7.3 (#3935)
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.7.2 to 5.7.3. - [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md) - [Commits](https://github.com/jackc/pgx/compare/v5.7.2...v5.7.3) --- updated-dependencies: - dependency-name: github.com/jackc/pgx/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
parent
a2caa5fdbb
commit
18c8f85a30
22 changed files with 608 additions and 209 deletions
13
vendor/github.com/jackc/pgx/v5/rows.go
generated
vendored
13
vendor/github.com/jackc/pgx/v5/rows.go
generated
vendored
|
|
@ -272,7 +272,7 @@ func (rows *baseRows) Scan(dest ...any) error {
|
|||
|
||||
err := rows.scanPlans[i].Scan(values[i], dst)
|
||||
if err != nil {
|
||||
err = ScanArgError{ColumnIndex: i, Err: err}
|
||||
err = ScanArgError{ColumnIndex: i, FieldName: fieldDescriptions[i].Name, Err: err}
|
||||
rows.fatal(err)
|
||||
return err
|
||||
}
|
||||
|
|
@ -334,11 +334,16 @@ func (rows *baseRows) Conn() *Conn {
|
|||
|
||||
type ScanArgError struct {
|
||||
ColumnIndex int
|
||||
FieldName string
|
||||
Err error
|
||||
}
|
||||
|
||||
func (e ScanArgError) Error() string {
|
||||
return fmt.Sprintf("can't scan into dest[%d]: %v", e.ColumnIndex, e.Err)
|
||||
if e.FieldName == "?column?" { // Don't include the fieldname if it's unknown
|
||||
return fmt.Sprintf("can't scan into dest[%d]: %v", e.ColumnIndex, e.Err)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("can't scan into dest[%d] (col: %s): %v", e.ColumnIndex, e.FieldName, e.Err)
|
||||
}
|
||||
|
||||
func (e ScanArgError) Unwrap() error {
|
||||
|
|
@ -366,7 +371,7 @@ func ScanRow(typeMap *pgtype.Map, fieldDescriptions []pgconn.FieldDescription, v
|
|||
|
||||
err := typeMap.Scan(fieldDescriptions[i].DataTypeOID, fieldDescriptions[i].Format, values[i], d)
|
||||
if err != nil {
|
||||
return ScanArgError{ColumnIndex: i, Err: err}
|
||||
return ScanArgError{ColumnIndex: i, FieldName: fieldDescriptions[i].Name, Err: err}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -468,6 +473,8 @@ func CollectOneRow[T any](rows Rows, fn RowToFunc[T]) (T, error) {
|
|||
return value, err
|
||||
}
|
||||
|
||||
// The defer rows.Close() won't have executed yet. If the query returned more than one row, rows would still be open.
|
||||
// rows.Close() must be called before rows.Err() so we explicitly call it here.
|
||||
rows.Close()
|
||||
return value, rows.Err()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue