Skip to content

Latest commit

 

History

History
40 lines (38 loc) · 1.63 KB

example_postgres.md

File metadata and controls

40 lines (38 loc) · 1.63 KB

PostgreSQL Example

Load database

  1. Launch docker database
  • docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres:latest
  1. connect to database using pgadmin
    • user: postgres
    • password: mysecretpassword
  2. Restore backup
  • copy contents of install.sql
  • locate pgadmin bin path and run
    • "C:\Program Files\pgAdmin 4\v6\runtime\psql.exe" "host='localhost' port='5432' dbname='Adventureworks' user='postgres' sslmode='prefer' sslcompression='False' " < install.sql

Commands

  1. generate output see
    schemacrawler \
      --server=postgresql --database=Adventureworks \
        --port=5432 --user=postgres --host=host.docker.internal --password=mysecretpassword \
      --info-level=maximum \
      --command script \
      --script-language python \
      --script ./share/mermaid.py > ./share/output_pg.md
  2. other commands
    • schemacrawler -h
    • schemacrawler \
        --server=postgresql --database=Adventureworks \
        --port=5432 --user=postgres --host=host.docker.internal --password=mysecretpassword \
        --info-level=maximum --command=schema > ./share/raw_pg.txt
    • schemacrawler \
        --server=postgresql --database=Adventureworks \
        --port=5432 --user=postgres --host=host.docker.internal --password=mysecretpassword \
        --info-level=maximum execute --command list