Skip to content

Conversation

@MeanSquaredError
Copy link
Contributor

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::detail namespace, placed them in include/sqlpp11/detail/parse_date_time.h and 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.h is 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

cmake -B build -DBUILD_POSTGRESQL_CONNECTOR=ON -DBUILD_SQLITE3_CONNECTOR=ON -DBUILD_MYSQL_CONNECTOR=ON -DBUILD_TESTING=ON -DUSE_SYSTEM_DATE=ON -DDEPENDENCY_CHECK=ON
cmake --build build -- VERBOSE=1
cd build
ctest

All tests passed successfully

@rbock
Copy link
Owner

rbock commented Aug 20, 2023

Thanks for unifying the date/time parsing. LGTM.

@rbock rbock merged commit d0dc081 into rbock:main Aug 20, 2023
@MeanSquaredError MeanSquaredError deleted the unify_date_time_parse branch August 20, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants