fschulze / sqlalchemy_schemadisplay

Other
143 stars 37 forks source link

Incompatible with SQLAlchemy 2.0.0 #33

Closed Zlopez closed 9 months ago

Zlopez commented 1 year ago

Today I got a automatic PR updating SQLAlchemy to 2.0.0 and the sqlalchemy_schemadisplay stopped working.

Here is the backtrace:

Traceback (most recent call last):
  File "/var/home/zlopez/git/anitya/docs/generate_db_schema", line 29, in <module>
    write_graph('images/database.png')
  File "/var/home/zlopez/git/anitya/docs/generate_db_schema", line 18, in write_graph
    graph = create_schema_graph(
  File "/var/home/zlopez/git/anitya/.tox/docs/lib/python3.10/site-packages/sqlalchemy_schemadisplay.py", line 153, in create_schema_graph
    label=_render_table_html(table, metadata, show_indexes, show_datatypes),
  File "/var/home/zlopez/git/anitya/.tox/docs/lib/python3.10/site-packages/sqlalchemy_schemadisplay.py", line 121, in _render_table_html
    if metadata.bind and isinstance(metadata.bind.dialect, PGDialect):
AttributeError: 'MetaData' object has no attribute 'bind'

The whole script for generation database schema could be found here.

return42 commented 1 year ago

I have the same issue .. BTW are there any plans to build a new release / on pypi there is v1.3 - 2016-01-27

Zlopez commented 9 months ago

This is fixed in 2.0 release.