MCPcopy
hub / github.com/jackc/pgx / TestConnExecEmpty

Function TestConnExecEmpty

pgconn/pgconn_test.go:1020–1038  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1018}
1019
1020func TestConnExecEmpty(t *testing.T) {
1021 t.Parallel()
1022
1023 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
1024 defer cancel()
1025
1026 pgConn, err := pgconn.Connect(ctx, os.Getenv("PGX_TEST_DATABASE"))
1027 require.NoError(t, err)
1028 defer closeConn(t, pgConn)
1029
1030 results, err := pgConn.Exec(ctx, ";").ReadAll()
1031 require.NoError(t, err)
1032 require.Len(t, results, 1)
1033 require.Nil(t, results[0].Err)
1034 require.Equal(t, "", results[0].CommandTag.String())
1035 require.Nil(t, results[0].FieldDescriptions)
1036
1037 ensureConnValid(t, pgConn)
1038}
1039
1040func TestConnExecMultipleQueries(t *testing.T) {
1041 t.Parallel()

Callers

nothing calls this directly

Calls 7

ConnectFunction · 0.92
ReadAllMethod · 0.80
closeConnFunction · 0.70
ensureConnValidFunction · 0.70
ExecMethod · 0.65
LenMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected