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

Function TestInsertTimestampArray

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

Source from the content-addressed store, hash-verified

923}
924
925func TestInsertTimestampArray(t *testing.T) {
926 t.Parallel()
927
928 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
929 defer cancel()
930
931 pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) {
932 if results := mustExec(t, conn, "create temporary table foo(spice timestamp[]);"); results.String() != "CREATE TABLE" {
933 t.Error("Unexpected results from Exec")
934 }
935
936 // Accept parameters
937 if results := mustExec(t, conn, "insert into foo(spice) values($1)", []time.Time{time.Unix(1419143667, 0), time.Unix(1419143672, 0)}); results.String() != "INSERT 0 1" {
938 t.Errorf("Unexpected results from Exec: %v", results)
939 }
940 })
941}
942
943func TestIdentifierSanitize(t *testing.T) {
944 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