MCPcopy Create free account
hub / github.com/bytebase/bytebase / queryForeignTableRows

Function queryForeignTableRows

backend/plugin/db/pg/sync_foreign_table_test.go:40–54  ·  view source on GitHub ↗
(t *testing.T, conn *sql.DB, query string)

Source from the content-addressed store, hash-verified

38`
39
40func queryForeignTableRows(t *testing.T, conn *sql.DB, query string) [][4]string {
41 t.Helper()
42 rows, err := conn.Query(query)
43 require.NoError(t, err)
44 defer rows.Close()
45
46 var result [][4]string
47 for rows.Next() {
48 var r [4]string
49 require.NoError(t, rows.Scan(&r[0], &r[1], &r[2], &r[3]))
50 result = append(result, r)
51 }
52 require.NoError(t, rows.Err())
53 return result
54}
55
56// TestListForeignTableQueryMatchesInformationSchema verifies that the pg_catalog-based
57// foreign table query produces exactly the same rows as the previous

Calls 4

ScanMethod · 0.80
QueryMethod · 0.65
CloseMethod · 0.65
NextMethod · 0.45

Tested by

no test coverage detected