0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00
Commit Graph

1450 Commits

Author SHA1 Message Date
MeanSquaredError
e7b50dadd4 Fix a false test failure in the sqlpp11.mysql.usage.DateTime caused by rounding down a timepoint. 2023-08-26 07:17:03 +00:00
MeanSquaredError
348511d078
A couple of minor cleanups in the PostgreSQL connector (#518)
* Replace ()-init with {}-init

* Move the method definitions for sqlpp::postgresql::detail::connection_handle inside the class.
2023-08-23 07:19:06 +02:00
MeanSquaredError
d0dc081625
Unify date/time value parsing in connectors (#517)
* Move the PostgreSQL date/time parsing code to common functions in sqlpp::detail

* Use the common date/time-parsing functions to parse the MySQL date/time results.

* Use regular expressions to parse date/time strings in the SQLite3 connector
2023-08-20 10:39:53 +02:00
MeanSquaredError
fdbfbc345e Replace ()-initialization with {}-initialization in the SQLite3 connector code. 2023-08-19 07:30:13 +00:00
MeanSquaredError
f7ad116ced Change method parameter type "const std::string" -> "const std::string&" 2023-08-17 05:28:16 +00:00
MeanSquaredError
c550dca89e
Cleanup SQLite3 connector code (#514)
* Move the code for sqlpp::sqlite3::detail::prepared_statement_handle_t to include/sqlpp11/sqlite3/detail/prepared_statement_handle.h

* Whitespace

* Move the code for sqlpp::sqlite3::detail::connection_handle to include/sqlpp11/sqlite3/detail/connection_handle.h

* Rename sqlpp::sqlite3::serializer_t -> sqlpp::sqlite3::context_t

* Add const qualifiers to sqlpp::mysql::context_t::escape() and its parameter.

* Change method argument types "const std::string" -> "const std::string&"

* Remove a superfluous function that forwards the call to sqlite3_close().

* Move initialization of sqlpp::sqlite3::detail::prepared_statement_handle_t data members from the constructor into the member initialization list.

* Rename method parameter from CamelCase to snake_case.
2023-08-17 07:26:54 +02:00
MeanSquaredError
4a9da95fda
Use brace-style initialization wherever possible. (#512)
Applied to the PostgreSQL connector.
2023-08-10 15:02:12 +00:00
MeanSquaredError
d800f4d6fa
Cleanup the code of the MySQL connector (#511)
* Move the method definitions for sqlpp::postgresql::detail::statement_handle_t inside the class.

* Move the method definitions for sqlpp::postgresql::detail::prepared_statement_handle_t inside the class.

* Move the method definitions for sqlpp::postgresql::prepared_statement_t inside the class.

* Move the method definitions for sqlpp::postgresql::::Result inside the class.

* Remove superfluous inline specifier from the in-class method definitions of sqlpp::postgresql::Result.

* Remove unused method declaration sqlpp::postgresql::Result::hasError()

* Move the method definitions for sqlpp::postgresql::bind_result_t inside the class.

* Move the method definitions for sqlpp::postgresql::connection_base inside the class.

* Add a comment explaining why sqlpp::postgresql::context_t::escape() is defined out-of-class.

* Remove incorrect comment about forward declaration

* Remove a superfluous function that forwards the call to PQFinish().

* Replace "std::string" parameters with "const std::string&".

* Remove superfluous detail:: namespace qualification.

* Rename class/struct types, variables and functions from CamelCase to snake_case.
2023-08-07 17:37:59 +00:00
MeanSquaredError
c03ac660ee
Use brace-style initialization wherever possible. (#510) 2023-08-07 07:37:29 +02:00
Roland Bock
37739bd2d7 Add missing template parameter
This fixes a compiler error for C++11/14
2023-08-06 10:18:59 +02:00
MeanSquaredError
490259ee69
Cleanup the code of the MySQL connector (#509)
* Move the code for sqlpp::mysql::detail::connection_handle_t to include/sqlpp11/mysql/detail/connection_handle.h
* Move the code for sqlpp::mysql::detail::prepared_statement_handle_t to include/sqlpp11/mysql/detail/prepared_statement_handle.h
* Move the code for sqlpp::mysql::detail::result_handle to include/sqlpp11/mysql/detail/result_handle.h
* Rename sqlpp::mysql::detail::connection_handle_t -> sqlpp::mysql::detail::connection_handle
* Rename sqlpp::mysql::serializer_t -> sqlpp::mysql::context_t
* Add const qualifiers to sqlpp::mysql::context_t::escape() and its parameter.
* Rename class/struct types, variables and functions from CamelCase to snake_case.
* Remove a superfluous function that forwards the call to mysql_close().
2023-08-05 09:18:51 +02:00
MeanSquaredError
3c598cd0b2
Fix building with sqlcipher (#508)
* Move cmake/Find*.cmake -> cmake/modules/Find*.cmake
* Add cmake/modules/FindSQLCipher.cmake from sqlpp17
2023-07-30 10:12:59 +02:00
MeanSquaredError
a085d730c9
Replace include guards with "#pragma once" in all header files and in the database model generator scripts. (#506) 2023-07-25 07:00:05 +02:00
Orange Cheers
b548cdc72d
Fix typo. (#505) 2023-07-25 06:51:33 +02:00
MeanSquaredError
4295c29e9a
Fix serialization of PostgreSQL time data types (#504)
* Use a non-UTC timezone when testing the PostgreSQL timezone support.
* Fix serialization of time of day values for PostgreSQL
* Fix serialization of PostgreSQL values for "timestamp with time zone" and "time with time zone" fields.
2023-07-24 06:40:18 +02:00
MeanSquaredError
4a1ed2c02e
Fix serialization of time points for MySQL. (#503) 2023-07-23 10:40:27 +02:00
MeanSquaredError
dff8c23b22
Connection pools (#499)
Add support for connection pooling

* Add support for connection pooling to the core code.
* Add support for PostgreSQL connection pooling with tests.
* Add support for SQLite3 connection pooling with tests.
* Add support for MySQL connection pooling with tests.
2023-07-17 06:14:23 +02:00
Roland Bock
a50d719364 Fix brace initialization, #498 2023-06-30 06:39:46 +02:00
MeanSquaredError
26280d2678
gcc warnings (#496)
* Enable std::move() by using std::string instead of const std::string&

* Fix dangling references.
2023-06-28 06:32:39 +02:00
Carel
babd420ecb
ddl2cpp command line argument for custom types (#491)
* ddl2cpp command line argument for custom types

- Updated the ddl2cpp script to allow custom/extended types through external csv file
- Had to re-order the script to allow the command line to be parsed before setting up the parser
- Updated README

* Test for the command line argument

- Script test only for now

* Test the custom type argument

- Firs a negative test
- Last a positive test and compile test against the generated output

* Expand the test

- Ensure built in types still work
- Check capitilisation
- Ensure more than one custom works
- Check type with spaces

---------

Co-authored-by: Carel Combrink <carel.combrink@vastech.co.za>
2023-06-22 07:06:00 +02:00
Carel
eac9a6e5e3
Const connection config (#494)
- The postgres connection does not change the connection_config thus passing it as const.
- Implies 'thread safety' when using the same config for multiple connections

Co-authored-by: Carel Combrink <carel.combrink@vastech.co.za>
2023-06-20 06:28:22 +02:00
MeanSquaredError
a72b172a52
Treat PostgreSQL time values as being in UTC time zone (#487)
* When inserting values into "timestamp with time zone" fields treat the value as being in the UTC time zone.

* Simplify parsing of PostgreSQL date/time responses by using regular expressions. Always convert response times with time zone to UTC.

* Add tests which check if timestamp and date fields are treated as having a UTC time zone.

* Clarify the test comments.
2023-06-16 06:57:19 +02:00
Matthijs Möhlmann
38aba217d4 std::string_view should also be assignable in prepared statements 2023-04-03 06:16:57 +02:00
Bernd Lörwald
9412851408
#471 serializers: ensure float precision (#472)
* value: add missing includes
* mysql, sqlite3: use explicitly *out* stringstreams for serialization
* postgresql: fix: use max_digits10 instead of digits10
* detail: add float_safe_ostringstream, ensuring floats are serialized with enough precision
* mysql, postgresql, sqlite3, tests: fix: set float-precision for all streams
* run clang-format on changed files
* inline remove_cvref.h
* replace unspecific "wrapper" with concrete type name
* tests: split connector specific tests out of serialize/Float
2023-02-18 08:10:50 +01:00
Bernd Lörwald
dfa297f069 ci: enable ctest output on failure 2023-02-11 09:04:45 +01:00
Roland Bock
64d16bfee0 Cleanup parens for ANY and SOME 2023-02-05 09:31:30 +01:00
Roland Bock
0731a8597d Cleanup parens for EXISTS 2023-02-04 10:21:54 +01:00
Roland Bock
2d3967a0b3 Cleanup braces for IS_NULL and IS NOT NULL 2023-02-04 10:12:55 +01:00
Roland Bock
1c4f1f61c8 Allow TRIM to be used with sub selects 2023-02-04 09:05:04 +01:00
Roland Bock
3fba3e721e Add UPPER and LOWER
This is replacing and extending #456.
2023-02-04 08:57:17 +01:00
Bernd Lörwald
7379e0001f ddl2cpp: allow inline column constraints ("PRIMARY KEY") but don't break auto-id 2023-01-31 06:32:00 +01:00
Roland Bock
82758a2046 Add missing braces to aggregatedfunctions with sub select #469
Also allow MIN and MAX to be used with DISTINCT.
2023-01-29 14:39:07 +01:00
Roland Bock
673b07361b Add missing braces to SUM with sub select #469 2023-01-29 12:57:02 +01:00
Roland Bock
743d39c0c6 Rename requires_braces to requires_parens
This fixes a typical German mistake :-)
2023-01-29 11:55:58 +01:00
Gonzalo Fernandez Yaique
5b0eee1c4c Extend match expression for table names in ddl2cpp
Using pg_dump, if the table is named after a special keyword (e.g. character),
is dumped as public."character".
This commit extends the names expression to match those cases.
2023-01-19 06:21:25 +01:00
Leonhard Kipp
a77d8009bb Add mysql DIV operator 2023-01-14 08:19:24 +01:00
Yagna Srinath Reddy Battula
bea910e122 Fix for namspace repetetion which should have been individual namespaces 2022-12-31 09:45:05 +01:00
Moritz Wirger
42bd3cc79b Fix include for iso646 missing for MSVC 2022-12-10 09:37:56 +01:00
Moritz Wirger
c550694b44 Fix mariadb include dir not found 2022-12-10 09:37:56 +01:00
hwhsu1231
2aa9797117 style: Align CMake files with 4 spaces indent 2022-11-26 08:32:46 +01:00
Leon De Andrade
648183fd64 Proper MariaDB and MySQl findPackage support 2022-08-21 09:54:58 +02:00
Roland Bock
4be8b9f654 Add example for #448 2022-06-20 06:58:51 +02:00
Leonhard Kipp
6ae27a922e Add ddlBracedArguments to expressions 2022-06-14 06:46:24 +02:00
Leonhard Kipp
c84f34d6f9 Add failing testcase 2022-06-14 06:46:24 +02:00
Jürgen Hunold
892e680a73 Add parser self-test to auto test suite 2022-06-08 06:35:39 +02:00
Jürgen Hunold
3c344c0546 Add support for "rationale" column type from pg_rational extension 2022-06-08 06:35:39 +02:00
Roland Bock
57077cd32b Add standalone insert_columns function (#76)
This allows for multi-row INSERT OR IGNORE
2022-06-06 10:15:28 +02:00
Roland Bock
256429730a Fix CMake warnings (CMP0115) 2022-06-06 10:14:01 +02:00
Roland Bock
f5be4095ae Allow parameter in having clause, see #443
Disallow mixing aggregate and non-aggregate columns in select, too.
2022-05-22 15:05:58 +02:00
Carlitxxx86
1e7f4b98c7 Added OR REPLACE clause 2022-04-25 06:37:40 +02:00