Skip to content

Commit

Permalink
Merge branch 'main' of github.com:dvanderweele/DBML_SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanderweele committed May 13, 2021
2 parents cac79c6 + 8bcb97a commit d2f8155
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 449 deletions.
47 changes: 46 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
DBML to SQLite Utility
======================

**v0.1.0**
**v0.2.0**

This is a simple package built on top of `the PyDBML package by
Vanderhoof <https://github.com/Vanderhoof/PyDBML>`__. It allows you,
Expand All @@ -25,6 +25,9 @@ Or:

poetry add dbml_sqlite

Note that if you install the tool on your system globally with pip, you
should be able to use the CLI anywhere.

Usage
-----

Expand Down Expand Up @@ -67,6 +70,48 @@ There are other functions in the package, but they are intended for
internal use only within the package. In-depth coverage of the rest of
the API is at the end of this README.

CLI
---

After installation, you can use the CLI from your terminal as follows:

::

dbml_sqlite [OPTIONS] SRC

SRC is mandatory and is the file containing dbml you want converted.

+---------------------------------------+-------------------------------+
| Options | Meaning |
+=======================================+===============================+
| -p, –print / -n, –no-print | Whether to print output to |
| | console. [default: print] |
+---------------------------------------+-------------------------------+
| -w, –write PATH | (Optional) File you want |
| | output written to. |
+---------------------------------------+-------------------------------+
| -x, –execute PATH | (Optional) SQLite database |
| | file for executing output DDL |
| | on. Will create file if it |
| | doesn’t exist. |
+---------------------------------------+-------------------------------+
| -f, –full / -h, –half | Full emulation mode (separate |
| | tables) or half emulation |
| | mode (check statements) for |
| | any enums defined in your |
| | dbml. [default: full] |
+---------------------------------------+-------------------------------+
| -t, –if-table-exists | (Optional) Add IF NOT EXISTS |
| | language to CREATE TABLE |
| | statements. |
+---------------------------------------+-------------------------------+
| -i, –if-index-exists | (Optional) Add IF NOT EXISTS |
| | language to CREATE INDEX |
| | statements. |
+---------------------------------------+-------------------------------+
| –help | Show this message and exit. |
+---------------------------------------+-------------------------------+

Writing SQLite Compatible DBML
------------------------------

Expand Down
Loading

0 comments on commit d2f8155

Please sign in to comment.