|
3 | 3 | DBML to SQLite Utility
|
4 | 4 | ======================
|
5 | 5 |
|
6 |
| -**v0.1.0** |
| 6 | +**v0.2.0** |
7 | 7 |
|
8 | 8 | This is a simple package built on top of `the PyDBML package by
|
9 | 9 | Vanderhoof <https://github.com/Vanderhoof/PyDBML>`__. It allows you,
|
|
25 | 25 |
|
26 | 26 | poetry add dbml_sqlite
|
27 | 27 |
|
| 28 | +Note that if you install the tool on your system globally with pip, you |
| 29 | +should be able to use the CLI anywhere. |
| 30 | + |
28 | 31 | Usage
|
29 | 32 | -----
|
30 | 33 |
|
@@ -67,6 +70,48 @@ There are other functions in the package, but they are intended for
|
67 | 70 | internal use only within the package. In-depth coverage of the rest of
|
68 | 71 | the API is at the end of this README.
|
69 | 72 |
|
| 73 | +CLI |
| 74 | +--- |
| 75 | + |
| 76 | +After installation, you can use the CLI from your terminal as follows: |
| 77 | + |
| 78 | +:: |
| 79 | + |
| 80 | + dbml_sqlite [OPTIONS] SRC |
| 81 | + |
| 82 | +SRC is mandatory and is the file containing dbml you want converted. |
| 83 | + |
| 84 | ++---------------------------------------+-------------------------------+ |
| 85 | +| Options | Meaning | |
| 86 | ++=======================================+===============================+ |
| 87 | +| -p, –print / -n, –no-print | Whether to print output to | |
| 88 | +| | console. [default: print] | |
| 89 | ++---------------------------------------+-------------------------------+ |
| 90 | +| -w, –write PATH | (Optional) File you want | |
| 91 | +| | output written to. | |
| 92 | ++---------------------------------------+-------------------------------+ |
| 93 | +| -x, –execute PATH | (Optional) SQLite database | |
| 94 | +| | file for executing output DDL | |
| 95 | +| | on. Will create file if it | |
| 96 | +| | doesn’t exist. | |
| 97 | ++---------------------------------------+-------------------------------+ |
| 98 | +| -f, –full / -h, –half | Full emulation mode (separate | |
| 99 | +| | tables) or half emulation | |
| 100 | +| | mode (check statements) for | |
| 101 | +| | any enums defined in your | |
| 102 | +| | dbml. [default: full] | |
| 103 | ++---------------------------------------+-------------------------------+ |
| 104 | +| -t, –if-table-exists | (Optional) Add IF NOT EXISTS | |
| 105 | +| | language to CREATE TABLE | |
| 106 | +| | statements. | |
| 107 | ++---------------------------------------+-------------------------------+ |
| 108 | +| -i, –if-index-exists | (Optional) Add IF NOT EXISTS | |
| 109 | +| | language to CREATE INDEX | |
| 110 | +| | statements. | |
| 111 | ++---------------------------------------+-------------------------------+ |
| 112 | +| –help | Show this message and exit. | |
| 113 | ++---------------------------------------+-------------------------------+ |
| 114 | + |
70 | 115 | Writing SQLite Compatible DBML
|
71 | 116 | ------------------------------
|
72 | 117 |
|
|
0 commit comments