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

Function execSql

frontend/tests/e2e/framework/psql.ts:23–36  ·  view source on GitHub ↗
(dbName: string, port: string, sql: string)

Source from the content-addressed store, hash-verified

21// Callers that interpolate non-constant values MUST validate them first
22// (see masking-exemption's assertSafeSqlIdentifier).
23export function execSql(dbName: string, port: string, sql: string): void {
24 execFileSync(
25 "psql",
26 [
27 "-h", "/tmp",
28 "-p", port,
29 "-U", "bbsample",
30 "-d", dbName,
31 "-v", "ON_ERROR_STOP=1",
32 "-c", sql,
33 ],
34 { stdio: "pipe" },
35 );
36}
37
38// Run a read query and return the raw scalar/tuple output (tuples-only,
39// unaligned). Reads as the owner (bbsample), so it reflects the committed

Calls

no outgoing calls

Tested by 2

createMaskingTestDataFunction · 0.72
dropMaskingTestDataFunction · 0.72