-
Notifications
You must be signed in to change notification settings - Fork 346
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
Cleanup the code of the MySQL connector #509
Conversation
…e/sqlpp11/mysql/detail/connection_handle.h
…o include/sqlpp11/mysql/detail/prepared_statement_handle.h
…p11/mysql/detail/result_handle.h
…ail::connection_handle
Thanks for experimenting with this. I think it makes sense to move code as suggested in the first three commits. I would prefer them as individual commits (if that makes sense, I have not checked them in detail). The renaming requires more discussion, I think. |
b3fb143
to
0d46442
Compare
@rbock I think the PR is ready for a review, so please take a look. |
0557523
to
42a06f4
Compare
Looks good to me. My only concern: This mixes several topics. In case something were broken with this CL, it would be easier to figure out the cause if they could be separate. The biggest change that is not related to moving code is the use of brace style initializers. If this can be separated into its own PR easily, I would prefer that. |
42a06f4
to
3da6f99
Compare
@rbock Please review this PR and let me know if further changes are required. |
3da6f99
to
1bd75b6
Compare
Force-pushed an update that removed a braced init that sneaked into this PR from the other PR. I think now this PR is ready for a review. |
Thanks for separating the changes! This looks good to me. |
OK, I updated the PR based on our discussion and I think it is ready for a review.
I mentioned my concern regarding the renaming of the types ending in _t here#500 (comment)
So it probably makes sense to postpone the merging of this PR until it is clear what to do with the renaming of these types.
This PR cleans up the code of the MySQL connector as per our discussion here
#500 (comment)
The PR makes the following changes to the MySQL connector:
connection_handle
,prepared_statement_handle
andresult_handle.h
are moved to separate files in theinclude/sqlpp11/mysql/detail/
directory.2. All class and struct type names ending in_t
have that suffix removed from their names. In some cases this caused some local variables and/or function parameters to be renamed in order avoid confusion and/or name clashes.sqlpp::mysql::connection_handle_t
has been renamed tosqlpp::mysql::connection_handle
as the other two connectors (PostgreSQL and SQLite3) haveconnection_handle
without the_t
suffix.sqlpp::mysql::serializer_t
has been renamed tosqlpp::mysql::context_t
sqlpp::mysql::context::escape()
and its parameter has been changed fromstd::string
toconst std::string&
.5. Old-style assignment-style parentheses-style initialization has been replaced with brace-style initialization. The only place where assignment-style initialization remains isauto var = {value}
where C++11 has problems.After making the changes the project was built with tests for the MySQL, PostgreSQL and SQLite3 connectors and all tests passed successfully.