Remove skip test for missing json type
All supported versions of PostgreSQL now have json type.
This commit is contained in:
+2
-18
@@ -3,9 +3,10 @@ package stdlib_test
|
||||
import (
|
||||
"bytes"
|
||||
"database/sql"
|
||||
"testing"
|
||||
|
||||
"github.com/jackc/pgx"
|
||||
"github.com/jackc/pgx/stdlib"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func openDB(t *testing.T) *sql.DB {
|
||||
@@ -497,10 +498,6 @@ func TestConnQueryJSONIntoByteSlice(t *testing.T) {
|
||||
db := openDB(t)
|
||||
defer closeDB(t, db)
|
||||
|
||||
if !serverHasJSON(t, db) {
|
||||
t.Skip("Skipping due to server's lack of JSON type")
|
||||
}
|
||||
|
||||
_, err := db.Exec(`
|
||||
create temporary table docs(
|
||||
body json not null
|
||||
@@ -537,10 +534,6 @@ func TestConnExecInsertByteSliceIntoJSON(t *testing.T) {
|
||||
db := openDB(t)
|
||||
defer closeDB(t, db)
|
||||
|
||||
if !serverHasJSON(t, db) {
|
||||
t.Skip("Skipping due to server's lack of JSON type")
|
||||
}
|
||||
|
||||
_, err := db.Exec(`
|
||||
create temporary table docs(
|
||||
body json not null
|
||||
@@ -575,15 +568,6 @@ func TestConnExecInsertByteSliceIntoJSON(t *testing.T) {
|
||||
ensureConnValid(t, db)
|
||||
}
|
||||
|
||||
func serverHasJSON(t *testing.T, db *sql.DB) bool {
|
||||
var hasJSON bool
|
||||
err := db.QueryRow(`select exists(select 1 from pg_type where typname='json')`).Scan(&hasJSON)
|
||||
if err != nil {
|
||||
t.Fatalf("db.QueryRow unexpectedly failed: %v", err)
|
||||
}
|
||||
return hasJSON
|
||||
}
|
||||
|
||||
func TestTransactionLifeCycle(t *testing.T) {
|
||||
db := openDB(t)
|
||||
defer closeDB(t, db)
|
||||
|
||||
Reference in New Issue
Block a user