MCPcopy Create free account
hub / github.com/dbt-labs/ade-bench / read_sql

Function read_sql

shared/scripts/run_sql.py:189–200  ·  view source on GitHub ↗

Read SQL from file or stdin.

(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

187
188
189def read_sql(args: argparse.Namespace) -> str:
190 """Read SQL from file or stdin."""
191 if args.sql_file:
192 sql_path = Path(args.sql_file)
193 if not sql_path.exists():
194 print(f"Error: SQL file not found: {args.sql_file}", file=sys.stderr)
195 sys.exit(1)
196 with open(sql_path, "r") as f:
197 return f.read()
198 else:
199 # Read from stdin
200 return sys.stdin.read()
201
202
203def execute_sql(conn, sql: str, db_type: str) -> None:

Callers 1

mainFunction · 0.85

Calls 1

openFunction · 0.85

Tested by

no test coverage detected