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

Function TestInsertBoolArray

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

Source from the content-addressed store, hash-verified

905}
906
907func TestInsertBoolArray(t *testing.T) {
908 t.Parallel()
909
910 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
911 defer cancel()
912
913 pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
914 if results := mustExec(t, conn, "create temporary table foo(spice bool[]);"); results.String() != "CREATE TABLE" {
915 t.Error("Unexpected results from Exec")
916 }
917
918 // Accept parameters
919 if results := mustExec(t, conn, "insert into foo(spice) values($1)", []bool{true, false, true}); results.String() != "INSERT 0 1" {
920 t.Errorf("Unexpected results from Exec: %v", results)
921 }
922 })
923}
924
925func TestInsertTimestampArray(t *testing.T) {
926 t.Parallel()

Callers

nothing calls this directly

Calls 4

RunWithQueryExecModesFunction · 0.92
mustExecFunction · 0.85
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected