Skip to content
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

Merged
merged 34 commits into from
Oct 25, 2021

Conversation

zekai427
Copy link
Contributor

@zekai427 zekai427 added the enhancement New feature or request label Oct 13, 2021
@zekai427 zekai427 self-assigned this Oct 13, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2021

Linux Test Report

     56 files     133 suites   36m 53s ⏱️
8 102 tests 8 102 ✔️ 0 💤 0
8 107 runs  8 107 ✔️ 0 💤 0

Results for commit 47d54bc.

♻️ This comment has been updated with latest results.

src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
@tobegit3hub
Copy link
Collaborator

Please add an unit test for the added API. It would better to test util functions with mock data.

src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd.h Outdated Show resolved Hide resolved
src/cmd/sql_cmd_test.cc Show resolved Hide resolved
src/cmd/sql_cmd_test.cc Outdated Show resolved Hide resolved
src/cmd/sql_cmd_test.cc Outdated Show resolved Hide resolved
src/cmd/sql_cmd_test.cc Outdated Show resolved Hide resolved
src/cmd/sql_cmd_test.cc Outdated Show resolved Hide resolved
src/cmd/sql_cmd_test.cc Outdated Show resolved Hide resolved
src/cmd/sql_cmd_test.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@tobegit3hub tobegit3hub left a 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,
Copy link
Collaborator

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()) {
Copy link
Collaborator

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");
Copy link
Collaborator

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.

@tobegit3hub tobegit3hub merged commit 9e7c999 into 4paradigm:main Oct 25, 2021
@zekai427 zekai427 deleted the addSaveResultSet branch October 27, 2021 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants