mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Use JSON format compat with PG and CockroachDB
This commit is contained in:
parent
fea4bc4318
commit
09371f21d0
@ -388,12 +388,12 @@ func TestConnQueryJSONIntoByteSlice(t *testing.T) {
|
|||||||
body json not null
|
body json not null
|
||||||
);
|
);
|
||||||
|
|
||||||
insert into docs(body) values('{"foo":"bar"}');
|
insert into docs(body) values('{"foo": "bar"}');
|
||||||
`)
|
`)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
sql := `select * from docs`
|
sql := `select * from docs`
|
||||||
expected := []byte(`{"foo":"bar"}`)
|
expected := []byte(`{"foo": "bar"}`)
|
||||||
var actual []byte
|
var actual []byte
|
||||||
|
|
||||||
err = db.QueryRow(sql).Scan(&actual)
|
err = db.QueryRow(sql).Scan(&actual)
|
||||||
@ -424,7 +424,7 @@ func TestConnExecInsertByteSliceIntoJSON(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
expected := []byte(`{"foo":"bar"}`)
|
expected := []byte(`{"foo": "bar"}`)
|
||||||
|
|
||||||
_, err = db.Exec(`insert into docs(body) values($1)`, expected)
|
_, err = db.Exec(`insert into docs(body) values($1)`, expected)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user