MCPcopy Create free account
hub / github.com/dolthub/doltgresql / copyFromStdin

Function copyFromStdin

testing/go/framework.go:339–351  ·  view source on GitHub ↗
(t *testing.T, conn *pgx.Conn, query string, filename string)

Source from the content-addressed store, hash-verified

337}
338
339func copyFromStdin(t *testing.T, conn *pgx.Conn, query string, filename string) {
340 filePath := filepath.Join("testdata", filename)
341
342 file, err := os.Open(filePath)
343 if err != nil {
344 t.Fatalf("Failed to open file: %v", err)
345 }
346 defer file.Close()
347
348 reader := bufio.NewReader(file)
349 _, err = conn.PgConn().CopyFrom(context.Background(), reader, query)
350 require.NoError(t, err)
351}
352
353// RunScripts runs the given collection of scripts. This normalizes all rows before comparing them.
354func RunScripts(t *testing.T, scripts []ScriptTest) {

Callers 1

runScriptFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected