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

389 Commits

Author SHA1 Message Date
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
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
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
hwhsu1231
2aa9797117 style: Align CMake files with 4 spaces indent 2022-11-26 08:32:46 +01:00
Roland Bock
4be8b9f654 Add example for #448 2022-06-20 06:58:51 +02:00
Jürgen Hunold
892e680a73 Add parser self-test to auto test suite 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
Carlitxxx86
92fa9d365d Added sample table definitions for System-Versioning
Both with implicit and explicit column definition.
2022-04-22 06:21:24 +02:00
Jürgen Hunold
9bfee74a99 Fix parsing of float fields with scale digits 2022-04-18 09:54:05 +02:00
Roland Bock
b50cc454b6 Fix constraints handling in ddl2cpp (#437)
Constraints got interpreted as (unknown) data types.
This change should fix this most cases (simple test case added).
2022-04-09 21:47:21 +02:00
Roland Bock
1d5caca523 Allow value_or_null to be assigned to parameters (#435) 2022-04-02 08:27:38 +02:00
Mike Neilson
03671ea75e Fixed ddl2cpp test setup and checks.
cmake file contained extra parameter that appears to no longer be used.
bad_has_parse_error test output check was not longer valid.
2022-03-11 07:47:22 +01:00
Mike Neilson
6477f09125 Added additional exception class.
Handles the case of user defined exception in pl/pgsql to it can be reported
back to the calling application.
2022-03-11 07:47:22 +01:00
Jürgen Hunold
f7f2060c44 Add support for TIME columns in postgresql 2022-02-08 18:24:15 +01:00
Jürgen Hunold
b2166c636b Untabify test list 2022-02-08 18:24:15 +01:00
Roland Bock
b8aed2af55 Address conversion warnings and fix UAF bug in test 2022-01-14 07:39:11 +01:00
Roland Bock
d6aef0fa9b Remove obsolete pointer indirection, fix warnings and a leak
Leak: The sqlite3 connection handle destructor was
accidentally turned into a default constructor during the
migration of repositories.

Replaced the sqlite3 raw pointer with a unique_ptr to prevent
this kind of accident.
2022-01-11 07:35:20 +01:00
Roland Bock
181cc5fb04 Fix compiler warnings. 2021-12-11 19:53:35 +01:00
Roland Bock
91b7b34557 Fix broken test code, see #400 2021-12-11 19:31:25 +01:00
Andreas Sommer
36d3d30254 Support MySQL connect timeout option 2021-12-10 10:57:06 +01:00
Leon De Andrade
d17bce9644
Add Connector CMake Logic (#394)
Add Connector Cmake logic

* Also install date when used with fetch content
* Install everything always
* Update documentation
* Add option to control dependency searching
* Adjust travis
2021-12-02 07:45:38 +01:00
Roland Bock
310a6245fa Added blob support for postgresql
Tests look reasonably fine.
2021-11-14 13:14:34 +01:00
Roland Bock
4c942600bb Started to migrate postgresql connector into sqlpp11 repo.
Removed timezone handling in the process (needs to be documented).
Note: on_conflict does not check for constraints (needs to be documented).
Note: some of the constraints tests seem to be aiming for a different static_assert.
2021-11-14 08:11:53 +01:00
Roland Bock
13698d07c9 Fix compile error for c++11 2021-11-11 07:21:28 +01:00
Roland Bock
8572c821aa Streamline test names and locations 2021-10-11 10:31:25 +02:00
Roland Bock
bde010351d Fix missing inline attributes for mysql connector
Changed mysql usage tests to be linked into one executable.
This provokes multiple definition errors for non-inlined free
functions.
2021-10-11 09:04:57 +02:00
Roland Bock
caee00e849 Fix missing inline attributes for sqlite3 connector
Changed sqlite3 usage tests to be linked into one executable.
This provokes multiple definition errors for non-inlined free
functions.
Also ran clang-format on the changed headers.
2021-10-11 08:37:14 +02:00
Roland Bock
136b533fcf Added shift left and shift right operators. 2021-09-04 13:40:03 +02:00
Roland Bock
0181639cb3 Add test for table alias. 2021-09-04 11:05:49 +02:00
Roland Bock
04629c1b92 Fix warning 2021-08-22 12:47:17 +02:00
Roland Bock
64aba48cb9 Make sqlite3 connector header-only 2021-08-22 12:44:34 +02:00
Roland Bock
2bb68cc443 Add time_point test for value_or_null 2021-08-22 11:39:48 +02:00
Roland Bock
660e3bd1b6 Make mysql connector header-only 2021-08-15 16:51:27 +02:00
Roland Bock
1d57d28994 Add order_by and limit for mysql remove and update
Thanks to ZerQAQ for suggesting this on github.
2021-08-14 10:56:45 +02:00
Roland Bock
2c1cc8ec89 Make mysql DateTime tests a bit stricter 2021-08-14 10:27:31 +02:00
Roland Bock
25a8dfa292 Add dynamic_insert_into test. 2021-08-06 10:14:24 +02:00
Roland Bock
5e16f32ed3 Moved mysql/mariadb connector over here. 2021-08-01 21:49:16 +02:00