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

Function mustExec

helper_test.go:56–62  ·  view source on GitHub ↗
(t testing.TB, conn *pgx.Conn, sql string, arguments ...any)

Source from the content-addressed store, hash-verified

54}
55
56func mustExec(t testing.TB, conn *pgx.Conn, sql string, arguments ...any) (commandTag pgconn.CommandTag) {
57 var err error
58 if commandTag, err = conn.Exec(context.Background(), sql, arguments...); err != nil {
59 t.Fatalf("Exec unexpectedly failed with %v: %v", sql, err)
60 }
61 return commandTag
62}
63
64// Do a simple query to ensure the connection is still usable
65func ensureConnValid(t testing.TB, conn *pgx.Conn) {

Callers 15

TestExecFunction · 0.85
TestListenNotifyFunction · 0.85
TestInsertBoolArrayFunction · 0.85
TestInsertTimestampArrayFunction · 0.85
TestConnSendBatchFunction · 0.85
TestConnSendBatchManyFunction · 0.85
TestTxSendBatchFunction · 0.85

Calls 1

ExecMethod · 0.65

Tested by

no test coverage detected