-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add a util for saving result set #508
Conversation
Please add an unit test for the added API. It would better to test util functions with mock data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Others LTGM
@@ -167,6 +168,9 @@ enum ReturnCode { | |||
kDatabaseNotFound = 802, | |||
kDatabaseNotEmpty = 803, | |||
|
|||
// sql_cmd | |||
kSQLCmdRunError = 901, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may use more error code for different command error.
|
||
file.open(file_path); | ||
std::string data_append; | ||
while (!file.eof()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the better API to get the content of file instead of reading line by line.
getline(file, line); | ||
data_append.append(line); | ||
} | ||
ASSERT_EQ(data_append, "col1,col2key1,1col1,col2key1,1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expected data should include the line breakers.
SELECT INTO OUTFILE
syntax #455