MCPcopy Create free account
hub / github.com/crate/crate / _execute_sql

Function _execute_sql

blackbox/test_docs.py:134–149  ·  view source on GitHub ↗

Invoke a single SQL statement and automatically close the HTTP connection when done.

(stmt)

Source from the content-addressed store, hash-verified

132
133
134def _execute_sql(stmt):
135 """
136 Invoke a single SQL statement and automatically close the HTTP connection
137 when done.
138 """
139 with connect(crate.http_url) as conn:
140 c = conn.cursor()
141 try:
142 c.execute(stmt)
143 return c
144 except ConnectionError as e:
145 logfile = os.path.join(crate.logs_path, crate.cluster_name + '.log')
146 with open(logfile, 'r') as f:
147 logs = f.read()
148 msg = str(e) + '\n' + logs
149 raise ConnectionError(msg, e.error_trace)
150
151
152def wait_for_schema_update(schema, table, column):

Callers 10

setUpLocationsFunction · 0.85
setUpUserVisitsFunction · 0.85
setUpArticlesFunction · 0.85
setUpColorsFunction · 0.85
setUpEmployeesFunction · 0.85
setUpDepartmentsFunction · 0.85
setUpQuotesFunction · 0.85
setUpPhotosFunction · 0.85
setUpCountriesFunction · 0.85

Calls 4

cursorMethod · 0.80
joinMethod · 0.80
executeMethod · 0.65
readMethod · 0.65

Tested by

no test coverage detected