Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
Update example with engine parameter.

Signed-off-by: Michal Konecny <[email protected]>
  • Loading branch information
Zlopez committed Feb 15, 2024
1 parent 63113d1 commit 5c17079
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ This is an example of database entity diagram generation:

.. code-block:: python
from sqlalchemy import MetaData
from sqlalchemy import MetaData, create_engine
from sqlalchemy_schemadisplay import create_schema_graph
# create the pydot graph object by autoloading all tables via a bound metadata object
graph = create_schema_graph(metadata=MetaData('postgres://user:pwd@host/database'),
graph = create_schema_graph(
engine=create_engine('postgresql+psycopg2://user:pwd@host/database'),
metadata=MetaData('postgres://user:pwd@host/database'),
show_datatypes=False, # The image would get nasty big if we'd show the datatypes
show_indexes=False, # ditto for indexes
rankdir='LR', # From left to right (instead of top to bottom)
Expand Down

0 comments on commit 5c17079

Please sign in to comment.