Unify date/time value parsing in connectors #517
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR unifies the date/time-parsing code in the PostgreSQL, MySQL and SQLite3 connectors using the code in the PostgreSQL connector as basis for the new common functions.
Essentially I moved the PostgreSQL date/time-parsing code into several common functions in the
sqlpp::detailnamespace, placed them ininclude/sqlpp11/detail/parse_date_time.hand then replaced the custom date/time-parsing code in the MySQL and SQLite3 connectors with calls to these common functions. The SQLite3 connector still has one custom date/time parsing function because its date_time data fields are a bit special in that they can hold either date_time fields or date fields.@rbock I am not sure if
include/sqlpp11/detail/parse_date_time.his the proper location for these common functions, so if you think that there is a better place for them, then I can adjust the PR.This PR was built and tested with
All tests passed successfully