mirror of https://github.com/jackc/pgx.git
Passthrough all parameters directly to pgx
parent
42cbd0fa46
commit
4ebf1d2e0b
|
@ -373,6 +373,11 @@ func (c *Conn) Ping(ctx context.Context) error {
|
|||
return c.conn.Ping(ctx)
|
||||
}
|
||||
|
||||
func (c *Conn) CheckNamedValue(*driver.NamedValue) error {
|
||||
// Underlying pgx supports sql.Scanner and driver.Valuer interfaces natively. So everything can be passed through directly.
|
||||
return nil
|
||||
}
|
||||
|
||||
type Stmt struct {
|
||||
sd *pgconn.StatementDescription
|
||||
conn *Conn
|
||||
|
|
|
@ -321,6 +321,15 @@ func TestConnQueryFailure(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestConnSimpleSlicePassThrough(t *testing.T) {
|
||||
testWithAndWithoutPreferSimpleProtocol(t, func(t *testing.T, db *sql.DB) {
|
||||
var n int64
|
||||
err := db.QueryRow("select cardinality($1::text[])", []string{"a", "b", "c"}).Scan(&n)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, 3, n)
|
||||
})
|
||||
}
|
||||
|
||||
// Test type that pgx would handle natively in binary, but since it is not a
|
||||
// database/sql native type should be passed through as a string
|
||||
func TestConnQueryRowPgxBinary(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue