MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / printLineExecutionResult

Method printLineExecutionResult

tools/shell/embedded_shell.cpp:1037–1054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035}
1036
1037std::string EmbeddedShell::printLineExecutionResult(QueryResult& queryResult) const {
1038 auto colNames = queryResult.getColumnNames();
1039 std::string printString = "";
1040 while (queryResult.hasNext()) {
1041 if (printInterrupted) {
1042 return std::string();
1043 }
1044 auto tuple = queryResult.getNext();
1045 for (auto i = 0u; i < queryResult.getNumColumns(); i++) {
1046 printString += colNames[i];
1047 printString += printer->TupleDelimiter;
1048 printString += tuple->getValue(i)->toString();
1049 printString += "\n";
1050 }
1051 printString += "\n";
1052 }
1053 return printString;
1054}
1055
1056std::string escapeCsvString(const std::string& field, const std::string& delimiter) {
1057 bool needsQuoting =

Callers

nothing calls this directly

Calls 6

getColumnNamesMethod · 0.45
hasNextMethod · 0.45
getNextMethod · 0.45
getNumColumnsMethod · 0.45
toStringMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected