(t *testing.T)
| 101 | } |
| 102 | |
| 103 | func TestJSONAndJSONBTranscodeExtendedOnly(t *testing.T) { |
| 104 | t.Parallel() |
| 105 | |
| 106 | conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE")) |
| 107 | defer closeConn(t, conn) |
| 108 | |
| 109 | for _, typename := range []string{"json", "jsonb"} { |
| 110 | if _, ok := conn.TypeMap().TypeForName(typename); !ok { |
| 111 | continue // No JSON/JSONB type -- must be running against old PostgreSQL |
| 112 | } |
| 113 | testJSONSingleLevelStringMap(t, conn, typename) |
| 114 | testJSONNestedMap(t, conn, typename) |
| 115 | testJSONStringArray(t, conn, typename) |
| 116 | testJSONInt64Array(t, conn, typename) |
| 117 | testJSONInt16ArrayFailureDueToOverflow(t, conn, typename) |
| 118 | testJSONStruct(t, conn, typename) |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | func testJSONString(t testing.TB, conn *pgx.Conn, typename string) { |
| 123 | input := `{"key": "value"}` |
nothing calls this directly
no test coverage detected