Alexis-benoist / eralchemy

Entity Relation Diagrams generation tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure when using on PG with citext extension enabled

claudyus opened this issue · comments

I try to make a DB diagram of a postgresql database using eralchemy version 1.2.7 and I get the following error:

/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:2650: SAWarning: Did not recognize type 'citext' of column 'name'
  (attype, name))
/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:2650: SAWarning: Did not recognize type 'citext' of column 'email'
  (attype, name))
/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:2650: SAWarning: Did not recognize type 'citext' of column 'first_name'
  (attype, name))
/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:2650: SAWarning: Did not recognize type 'citext' of column 'last_name'
  (attype, name))
/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py:2650: SAWarning: Did not recognize type 'citext' of column 'account_number'
  (attype, name))
Traceback (most recent call last):
  File "/home/cmignanti/.envs/labjack/bin/eralchemy", line 11, in <module>
    sys.exit(cli())
  File "/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/eralchemy/main.py", line 38, in cli
    schema=args.s
  File "/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/eralchemy/main.py", line 231, in render_er
    tables, relationships = all_to_intermediary(input, schema=schema)
  File "/home/cmignanti/.envs/labjack/local/lib/python2.7/site-packages/eralchemy/main.py", line 152, in all_to_intermediary
    raise ValueError(msg)
ValueError: Cannot process filename_or_input str

I believe this is related to the usage of citext extension in on db table. You can find more info about citext here [1] but I believe that for this project those can be consider text fields.

  1. https://www.postgresql.org/docs/current/static/citext.html

The command was simple:
eralchemy -i postgres://db:dbpassword@172.17.0.1/portal?sslmode=disable -o schema.png

I too see a similar issue using citext.

/lib/python3.9/site-packages/eralchemy/sqla.py:84: SAWarning: Did not recognize type 'citext' of column 'name'
  Base.prepare(engine, reflect=True, name_for_scalar_relationship=name_for_scalar_relationship)

Is there a way around this?

ERAlchemy: 1.2.10
Python: 3.9.2