0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2025-01-14 09:47:58 +08:00

89 Commits

Author SHA1 Message Date
MeanSquaredError
f6cb4d311a ddl2cpp: Add tests for the column isPrimaryKey property. 2024-06-12 20:22:06 +02:00
MeanSquaredError
ffd6618e58 Treat "PRIMARY KEY" columns as not nullable. 2024-06-12 20:22:06 +02:00
MeanSquaredError
43fa5c445c ddl2cpp: Require word breaks when parsing SQL keywords. 2024-06-12 07:25:19 +02:00
MeanSquaredError
8797dfd79e Recognize serial2, serial4 and serial8 types when parsing SQL definitions in the ddl2cpp script. 2024-06-11 06:36:13 +02:00
MeanSquaredError
a1baba0ab7 Fix warnings in Python regexes by adding missing backslashes. 2023-11-17 08:52:00 +00: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
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
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
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
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
3c344c0546 Add support for "rationale" column type from pg_rational extension 2022-06-08 06:35:39 +02:00
Carlitxxx86
0c3c09dc2f Added instructions to ignore OR REPLACE clause 2022-04-25 06:37:40 +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
Yuanhao Jia
9fc07ef757 Fix namespace closing comment order in ddl2cpp script 2022-03-04 06:55:20 +01:00
linrongbin
1b10d36030 add mediumtext data type for mysql in ddl2cpp script 2022-02-11 07:47:04 +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
Zach Toogood
62f987ef44
Various additions to ddl2cpp for MySQL (#416) 2022-01-16 17:22:17 +01:00
Roland Bock
310a6245fa Added blob support for postgresql
Tests look reasonably fine.
2021-11-14 13:14:34 +01:00
Sylvain Joubert
b4acfa27e9 ddl2cpp: Fix compatibility with pyparsing 3+
Fix #388
2021-11-10 19:29:40 +01:00
Brett-Michael Green
cab4bc79ed Add some MYSQL types to the ddl2cpp script 2020-06-17 07:26:26 +02:00
Sylvain Joubert
183a05156a
Add begin and end keywords in the reserved names to be escaped (#310) 2020-02-06 10:58:53 +01:00
rbock
268c176d8a Adjust sample.sql and ddl2cpp to match Sample.h 2019-10-05 10:20:15 +02:00
rbock
e9f6f07677 Merge branch 'release/0.58' 2019-04-18 09:15:31 +02:00
rbock
80e25a5e52 Add AUTOINCREMENT support in ddl2cpp for sqlite3 2019-03-03 09:11:33 +01:00
rbock
052dbe10b2 Re-added accidentally removed real type to ddl2cpp 2018-12-24 17:44:17 +01:00
Aaron Bishop
4c53ffcb3f Add option to ddl2cpp to enable splitting tables into individual header files 2018-09-25 08:43:10 -04:00
L3nn0x
c7e73a0516 Added mediumint unsigned to dll2cpp 2018-07-15 19:35:58 +01:00
rbock
5213022a80 Fix merge error. 2018-06-01 10:30:18 +02:00
rbock
a643095958 Merge branch 'release/0.55' 2018-06-01 09:53:06 +02:00
Andreas C. Osowski
18e1c180fe
ddl2cpp: support CHECK constraint 2018-04-18 19:02:06 +02:00
Sergei Nikulov
9a5df4cca2 sqlite3: added real data type 2018-04-09 22:23:00 +03:00
Sylvain Joubert
805c6476f4 Add more PostgreSQL type mapping in ddl2cpp 2018-02-26 14:24:27 +01:00
Arne Luenser
5e8d81adbf Allow digits 0-9 in include guards 2018-02-13 10:29:28 +01:00
Roland Bock
a2b22b9bac
Merge pull request #215 from sjoubert/ddl2cpp_identity_naming
Add the possibility to keep the table and column names as in the DDL
2018-02-08 19:46:41 +01:00
Sylvain Joubert
d2d9a1693c Add the possibility to keep the table and column names as in the DDL 2018-02-08 13:23:14 +01:00
Sylvain Joubert
20ab921a5a Add mapping of the 'clob' type to the existing 'text' type 2018-02-08 13:22:47 +01:00
rbock
109b0af880 Add quoting for table and column names.
More reserved words have to be added to ddl2cpp
2017-11-26 19:19:26 +01:00
rbock
e90a988a69 Remove some commented lines 2017-11-07 13:00:33 +01:00
rbock
8d92de3fe9 Remove debug printout 2017-11-07 08:57:31 +01:00
rbock
fd939975ee Scan for unsigned integral columns 2017-11-06 21:37:10 +01:00
Serge Robyns
02cf37e3e3 Fixed mising namespace comment on tablenames (to silence clang-tidy). 2017-08-09 17:50:26 +02:00
rbock
cd778444d6 Merge branch 'release/0.49' 2017-06-04 15:58:40 +02:00
Andreas Sommer
e77639033a Support implicitly treating id column as auto-incrementing (e.g. for SQLite) 2017-06-03 00:41:44 +02:00
L3nn0x
55d0e2ac0d Added mediumint to ddl2cpp 2017-04-25 22:23:59 +02:00
rbock
f88efada67 Allow for "IF NOT EXISTS" in createTable in ddl 2017-03-05 19:50:55 +01:00
rbock
e53bbcc9bd Support for PostgreSQL serial 2017-03-05 19:13:26 +01:00
mlimber
3baa513a07 Allow nested namespaces on the command line
Allow the generator to handle nested namespaces like:
    ddl2cpp table.ddl table My::Nested::Namespaces
2017-01-07 00:16:50 -05:00
strangeqargo
3d2dae9bb1 fixed 2016-06-09 19:19:37 +03:00
strangeqargo
bcd7341476 fix formatting 2016-06-09 19:18:15 +03:00
“digitalist.ru”
ec6c36d541 fix typo 2016-05-15 01:05:08 +03:00
“digitalist.ru”
e80f06e2a3 fix 2016-05-15 01:02:46 +03:00
strangeqargo
de2409dd7e remove regression 2016-05-14 16:21:35 +03:00
strangeqargo
32dfdf7f4d merge with devel with regression 2016-05-14 16:11:48 +03:00
strangeqargo
11f40dc20c small cleanup, pre-merging 2016-05-14 15:57:26 +03:00
strangeqargo
897d581eec fix -[no-]- display in arguments 2016-05-14 14:33:28 +03:00
strangeqargo
a5421e8c34 adding help, remove debug output 2016-05-14 14:30:08 +03:00
strangeqargo
e457757ec5 heavy refactoring 2016-05-05 23:08:27 +03:00
strangeqargo
ffc2dd0f3c doing 2016-05-05 02:40:44 +03:00
strangeqargo
42dfa6cddc argument parsing, fail on parsing 2016-05-05 01:58:53 +03:00
“digitalist.ru”
6b7bdb1e62 fix my mistake 2016-03-26 14:51:25 +03:00
Roland Bock
4797521031 Merge pull request #71 from digitalist/readme
Readme and ddl2cpp error handling
2016-03-22 07:06:18 +01:00
“digitalist.ru”
772109fc87 ddl2cpp solutions 2016-03-22 00:28:06 +03:00
“digitalist.ru”
64a122b64a ddl2cpp solutions 2016-03-22 00:27:01 +03:00
“digitalist.ru”
c43b8272ba readme/ddl2cpp KeyError handling, merging 2016-03-21 22:04:34 +03:00
“digitalist.ru”
0ed744d70b readme/ddl2cpp KeyError handling 2016-03-21 21:48:11 +03:00
“digitalist.ru”
b7b651e98b readme/ddl2cpp KeyError handling 2016-03-21 21:38:37 +03:00
rbock
dc9f03fb56 Added enum and set to be interpreted as text
Maybe we will need a better mapping one fine day...
2016-03-20 18:27:38 +01:00
rbock
1b2020a5d2 Allow table name in ticks
This is what mysqldump generates for instance.
2016-03-19 21:05:32 +01:00
rbock
9bc9575723 Cleanup for ddl2cpp (thanks, David) 2016-03-19 21:05:09 +01:00
rbock
af6811bb4d Adjusted ddl2cpp to work with pyparsing-2.10 2016-03-19 21:04:43 +01:00
rbock
f16643a1a0 Allow negative numbers in ddl2cpp 2015-12-23 18:28:15 +01:00
rbock
173d6adbc9 Moved data types into separate folder, split boolean
Each file within data_types/boolean/ is relatively short and easy to
grok.
2015-10-29 22:21:46 +01:00
rbock
84ab264702 Renamed date/date_time to day_point/time_point 2015-10-29 16:41:45 +01:00
rbock
56d312a59b Added compile time tests for date and date_time 2015-10-13 21:25:10 +02:00
rbock
b062f2ade7 Revert "Replaced char[] with char[<sizeof>] to please MSVC 2015"
This reverts commit 30a3a6b2ff1bb2cad4b3556855add5b0a0875831.
2015-06-01 22:12:32 +02:00
rbock
30a3a6b2ff Replaced char[] with char[<sizeof>] to please MSVC 2015 2015-05-29 20:06:21 +02:00
rbock
97de6fad7f Adjusted license dates 2015-02-15 19:00:21 +01:00
rbock
74cafe35dd We now have unique name representations per name
Before this, there could be multiple classes representing multiple id
columns. Now there is one class representing ALL the name "id". Very
important for analyzing potential name clashes.
2014-11-30 19:40:34 +01:00
rbock
d75862365b Cleanup in generated code 2014-08-27 21:32:00 +02:00
rbock
80f09dc003 Use _traits in column specs 2014-07-23 18:06:33 +02:00
rbock
8ed0042b67 Added blob (currently synonym of text) 2014-07-14 18:17:53 +02:00
rbock
bef4d0874b Updates copyright year 2014-03-27 16:43:36 +01:00
rbock
ec2a8587d4 Added python code generator as an example 2014-01-28 20:53:22 +01:00