0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 12:51:13 +08:00
Commit Graph

1481 Commits

Author SHA1 Message Date
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
Carlitxxx86
0c3c09dc2f Added instructions to ignore 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
Carlitxxx86
31ef4f2e54 Added MariaDB keywords GENERATED and PERIOD
Both keywords are used for System Versioned tables.
GENERATED marks a column as auto generated.
PERIOD is ignored fro the script.
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
Roland Bock
052c8a9e3c
Fix typo. 2022-03-13 11:22:10 +01: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
Roland Bock
b965b2a1df Fix warnings (#422) 2022-03-04 07:49:05 +01:00
Yuanhao Jia
9fc07ef757 Fix namespace closing comment order in ddl2cpp script 2022-03-04 06:55:20 +01:00
Roland Bock
dd4d023bec
Update README.md 2022-03-03 08:17:54 +01:00
linrongbin
1b10d36030 add mediumtext data type for mysql in ddl2cpp script 2022-02-11 07:47:04 +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
5b3abca4b1 Partial rewrite of ddl2cpp
Initially setting out to fix #418, this change
  - accepts more SQL expressions
  - uses slightly more idiomatic pyparsing, I believe
  - uses black formatter
  - comes with some unit tests for the parser
  - simplifies options

Tested with all SQL files in the repo.
2022-02-06 17:33:22 +01:00
vrqq
d8a76fa282
Fix part of issue #418 (#419)
The first problem in https://github.com/rbock/sqlpp11/issues/418

Match table name ```"public"."dk"``` to ```_literal[] = public.dk``` and ```struct PublicDK```
2022-01-31 07:00:58 +01:00
Navid Jalali
d8f841121b
clone from origin/main (#417) 2022-01-22 21:47:16 +01:00
Zach Toogood
62f987ef44
Various additions to ddl2cpp for MySQL (#416) 2022-01-16 17:22:17 +01:00