Skip to content

Commit 54ca880

Browse files
MeanSquaredErrorrbock
authored andcommitted
Document the ddl2cpp command-line options.
1 parent 18656d2 commit 54ca880

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

docs/ddl2cpp.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,44 @@ mysqldump --no-data MyDatabase > MyDatabase.sql
2121

2222
For detailed instructions refer to the documentation of your database.
2323

24-
## Generate C++ headers
24+
## Command-line options
25+
26+
**Help**
27+
| Option | Required | Default | Description | Before v0.67 |
28+
| ------ | -------- | ------- | ----------- | ------------ |
29+
| -h or --help | No[^1] | | Display help and exit. | Same |
30+
31+
**Required parameters for code generation**
32+
| Option | Required | Default | Description | Before v0.67 |
33+
| ------ | -------- | ------- | ----------- | ------------ |
34+
| --path-to-ddl PATH_TO_DDL ... | Yes | | One or more pathnames of input DDL files. | First command-line argument |
35+
| --namespace NAMESPACE | Yes | | C++ namespace of the generated database model. | Third command-line argument |
36+
37+
**Paths**
38+
| Option | Required | Default | Description | Before v0.67 |
39+
| ------ | -------- | ------- | ----------- | ------------ |
40+
| --path-to-header PATH_TO_HEADER | No[^3] | | Output pathname of the generated C++ header. | Second command-line argument |
41+
| --path-to-header-directory PATH_TO_HEADER_DIRECTORY | No[^3] | | Output Directory for the generated C++ headers | Second command-line argument + -split-tables. |
42+
| --path-to-module PATH_TO_MODULE | No[^2][^3] | | Output pathname of the generated C++ module. | N/A |
43+
| --path-to-datatype-file PATH_TO_DATATYPE_FILE | No | | Input pathname of a CSV file defining aliases of existing data types. | Same |
44+
45+
**Additional options**
46+
| Option | Required | Default | Description | Before v0.67 |
47+
| ------ | -------- | ------- | ----------- | ------------ |
48+
| --module-name MODULE_NAME | No[^2] | | Name of the generated C++ module | N/A |
49+
| --suppress-timestamp-warning | No | False | Don't display a warning when date/time data types are used. | -no-timestamp-warning |
50+
| --assume-auto-id | No | False | Treat columns called *id* as if they have a default auto-increment value. | -auto-id |
51+
| --naming-style {camel-case,identity} | No | camel-case | Naming style for generated tables and columns. *camel-case* interprets *_* as word separator and translates table names to *UpperCamelCase* and column names to *lowerCamelCase*. *identity* uses table and column names as-is in generated code. | -identity-naming |
52+
| --generate-table-creation-helper | No | False | For each table in the database model create a helper function that drops and creates the table. | N/A |
53+
| --use-import-sqlpp23 | No | False | Import sqlpp23 as module instead of including the header file. | N/A |
54+
| --use-import-std | No | False | Import std as module instead of including the respective standard header files. | N/A |
55+
| --self-test | No[^1] | | Run parser self-test. | -test |
56+
57+
[^1]: Overrides every other option.
58+
[^2]: To generate a C++ module, both --path-to-module and --module-name should be specified.
59+
[^3]: Exactly one of --path-to-module, --path-to-header or --path-to-header-directory should be specified.
60+
61+
## Examples of program usage
2562

2663
Once you have the DDL files, you can create C++ headers or modules for them with provided
2764
[sqlpp23-ddl2cpp](/scripts) script, e.g.

0 commit comments

Comments
 (0)