Skip to content

Instantly share code, notes, and snippets.

@evadne
Last active April 5, 2024 14:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save evadne/440558b18228ca657ef22b465793a0c3 to your computer and use it in GitHub Desktop.
Save evadne/440558b18228ca657ef22b465793a0c3 to your computer and use it in GitHub Desktop.
Using SchemaCrawler on PostgreSQL databases

Generate Schema Diagram (with SchemaCrawler)

See also: SchemaCrawler Database Diagramming.

  1. Downlod the latest release of SchemaCrawler, for example v14.16.01 was tested to work.

  2. Ensure Java is in place.

  3. Run:

    $ ./schemacrawler.sh \
        -server=postgresql \
        -host=localhost \
        -port=5432 \
        -database={…} \
        -schemas={…} \
        -user={…} \
        -password={…} \
        -infolevel=standard \
        -command=schema \
        -outputformat=png \
        -outputfile=graph.png
    
  4. See output: graph.png

@emedinag
Copy link

emedinag commented Apr 5, 2024

fix dashes

schemacrawler.sh --server=postgresql --host=localhost --port=5432 --database=database --schemas=public --user=userbd --password=passwd --info-level=standard --command=schema --output-format=png --output-file=graph.pn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment