We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select()
sql.RawBytes
The conditions for this to happen are a little strange:
db.Select()
bytea
$1
postgres=# create table foo (data bytea); CREATE TABLE postgress=# insert into foo values ('\xdead'), ('\xbeef'), ('\xdeadbeef'); INSERT 0 3 postgres=# select * from foo; data -------- \xdead \xbeef \xdeadbeef (3 rows)
db := sqlx.MustConnect("postgres", ...) var result [][]byte db.Select(&result, `select * from foo where $1=1`, 1) fmt.Printf("%x %x %x\n", result[0], result[1], result[2]) var result2 []sql.RawBytes db.Select(&result2, `select * from foo where $1=1`, 1) fmt.Printf("%x %x %x\n", result2[0], result2[1], result2[2]) /* dead beef deadbeef 2033 2033 203300ef */
I didn't notice this problem with Query or Queryx.
Query
Queryx
postgres:16-alpine
lib/pq
sqlx
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The conditions for this to happen are a little strange:
db.Select()
must be usedbytea
sql.RawBytes
(or a struct field that issql.RawBytes
)$1
I didn't notice this problem with
Query
orQueryx
.postgres:16-alpine
docker image)lib/pq
v1.10.9sqlx
v1.4.0The text was updated successfully, but these errors were encountered: