| 310 | } |
| 311 | |
| 312 | string Prompt::ExecuteSQL(ShellState &state, const string &query) { |
| 313 | string query_result; |
| 314 | auto &con = GetConnection(state); |
| 315 | auto exec_result = state.ExecuteSQLSingleValue(con, query, query_result); |
| 316 | switch (exec_result) { |
| 317 | case ExecuteSQLSingleValueResult::SUCCESS: |
| 318 | return query_result; |
| 319 | case ExecuteSQLSingleValueResult::EMPTY_RESULT: |
| 320 | return "#EMPTY#"; |
| 321 | case ExecuteSQLSingleValueResult::MULTIPLE_ROWS: |
| 322 | return "#MULTIPLE_ROWS#"; |
| 323 | case ExecuteSQLSingleValueResult::MULTIPLE_COLUMNS: |
| 324 | return "#MULTIPLE_COLUMNS#"; |
| 325 | case ExecuteSQLSingleValueResult::NULL_RESULT: |
| 326 | return "#NULL#"; |
| 327 | case ExecuteSQLSingleValueResult::EXECUTION_ERROR: |
| 328 | default: |
| 329 | return "#ERROR"; |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | string Prompt::GeneratePrompt(ShellState &state) { |
| 334 | string prompt; |
nothing calls this directly
no test coverage detected