mirror of https://github.com/jackc/pgx.git
ref: remove anchored code
parent
71da600c3a
commit
4ac1499060
24
conn.go
24
conn.go
|
@ -366,30 +366,6 @@ func (c *Conn) Ping(ctx context.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func connInfoFromRows(rows Rows, err error) (map[string]uint32, error) {
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer rows.Close()
|
|
||||||
|
|
||||||
nameOIDs := make(map[string]uint32, 256)
|
|
||||||
for rows.Next() {
|
|
||||||
var oid uint32
|
|
||||||
var name pgtype.Text
|
|
||||||
if err = rows.Scan(&oid, &name); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
nameOIDs[name.String] = oid
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = rows.Err(); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nameOIDs, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// PgConn returns the underlying *pgconn.PgConn. This is an escape hatch method that allows lower level access to the
|
// PgConn returns the underlying *pgconn.PgConn. This is an escape hatch method that allows lower level access to the
|
||||||
// PostgreSQL connection than pgx exposes.
|
// PostgreSQL connection than pgx exposes.
|
||||||
//
|
//
|
||||||
|
|
|
@ -108,13 +108,13 @@ func (o *LargeObject) Tell() (n int64, err error) {
|
||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trunctes the large object to size.
|
// Truncate the large object to size.
|
||||||
func (o *LargeObject) Truncate(size int64) (err error) {
|
func (o *LargeObject) Truncate(size int64) (err error) {
|
||||||
_, err = o.tx.Exec(o.ctx, "select lo_truncate64($1, $2)", o.fd, size)
|
_, err = o.tx.Exec(o.ctx, "select lo_truncate64($1, $2)", o.fd, size)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close closees the large object descriptor.
|
// Close the large object descriptor.
|
||||||
func (o *LargeObject) Close() error {
|
func (o *LargeObject) Close() error {
|
||||||
_, err := o.tx.Exec(o.ctx, "select lo_close($1)", o.fd)
|
_, err := o.tx.Exec(o.ctx, "select lo_close($1)", o.fd)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue