-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81fbe01
commit 460f5db
Showing
8 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
format_col_type | ||
=============== | ||
|
||
.. currentmodule:: sqlmermaid | ||
|
||
.. autofunction:: format_col_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
get_mermaid | ||
=========== | ||
|
||
.. currentmodule:: sqlmermaid | ||
|
||
.. autofunction:: get_mermaid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
open_in_browser | ||
=============== | ||
|
||
.. currentmodule:: sqlmermaid | ||
|
||
.. autofunction:: open_in_browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
to_file | ||
======= | ||
|
||
.. currentmodule:: sqlmermaid | ||
|
||
.. autofunction:: to_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
to_mermaid_node | ||
=============== | ||
|
||
.. currentmodule:: sqlmermaid | ||
|
||
.. autofunction:: to_mermaid_node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Installation: | ||
============= | ||
|
||
using pip | ||
--------- | ||
|
||
``pip install sqlmermaid`` | ||
|
||
.. code:: ipython3 | ||
from sqlmermaid import __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. code:: ipython3 | ||
import sqlalchemy as sa | ||
from sqlmermaid import get_mermaid | ||
metadata_obj = sa.MetaData() | ||
.. code:: ipython3 | ||
user = sa.Table( | ||
"user", | ||
metadata_obj, | ||
sa.Column("user_id", sa.Integer, primary_key=True), | ||
sa.Column("user_name", sa.String(16), nullable=False), | ||
sa.Column("email_address", sa.String(60)), | ||
sa.Column("nickname", sa.String(50), nullable=False), | ||
) | ||
.. code:: ipython3 | ||
departments = sa.Table( | ||
"departments", | ||
metadata_obj, | ||
sa.Column("department_id", sa.Integer, primary_key=True), | ||
sa.Column("department_name", sa.String(60), nullable=False), | ||
) | ||
.. code:: ipython3 | ||
employees = sa.Table( | ||
"employees", | ||
metadata_obj, | ||
sa.Column("employee_id", sa.Integer, primary_key=True), | ||
sa.Column("employee_name", sa.String(60), nullable=False), | ||
sa.Column("employee_dept", sa.Integer, sa.ForeignKey("departments.department_id")), | ||
) | ||
.. code:: ipython3 | ||
user_complaints = sa.Table( | ||
"complaints", | ||
metadata_obj, | ||
sa.Column("about_dept", sa.Integer, sa.ForeignKey("departments.department_id")), | ||
sa.Column("by_user", sa.Integer, sa.ForeignKey("user.user_id")), | ||
sa.Column("at_time", sa.DateTime), | ||
sa.Column("text", sa.String(500)), | ||
sa.Index("comp_ind", "text"), | ||
) | ||
.. code:: ipython3 | ||
constr = "sqlite:///db3.sqlite" # "sqlite:///:memory:" | ||
engine = sa.create_engine(constr) | ||
metadata_obj.create_all(engine) | ||
print(get_mermaid(constr)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
v0.0.0 | ||
------ | ||
|
||
yay, first release |