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

Function TestConnPrepareSyntaxError

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

Source from the content-addressed store, hash-verified

875}
876
877func TestConnPrepareSyntaxError(t *testing.T) {
878 t.Parallel()
879
880 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
881 defer cancel()
882
883 pgConn, err := pgconn.Connect(ctx, os.Getenv("PGX_TEST_DATABASE"))
884 require.NoError(t, err)
885 defer closeConn(t, pgConn)
886
887 psd, err := pgConn.Prepare(ctx, "ps1", "SYNTAX ERROR", nil)
888 require.Nil(t, psd)
889 require.NotNil(t, err)
890
891 ensureConnValid(t, pgConn)
892}
893
894func TestConnPrepareContextPrecanceled(t *testing.T) {
895 t.Parallel()

Callers

nothing calls this directly

Calls 4

ConnectFunction · 0.92
closeConnFunction · 0.70
ensureConnValidFunction · 0.70
PrepareMethod · 0.65

Tested by

no test coverage detected