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

Function TestPrepareBadSQLFailure

conn_test.go:535–546  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

533}
534
535func TestPrepareBadSQLFailure(t *testing.T) {
536 t.Parallel()
537
538 conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE"))
539 defer closeConn(t, conn)
540
541 if _, err := conn.Prepare(context.Background(), "badSQL", "select foo"); err == nil {
542 t.Fatal("Prepare should have failed with syntax error")
543 }
544
545 ensureConnValid(t, conn)
546}
547
548func TestPrepareIdempotency(t *testing.T) {
549 t.Parallel()

Callers

nothing calls this directly

Calls 4

mustConnectStringFunction · 0.85
closeConnFunction · 0.70
ensureConnValidFunction · 0.70
PrepareMethod · 0.65

Tested by

no test coverage detected