I am using sqlacodegen for the first time to generate Python class models 
from an existing PostgreSQL database. 

when running this :
% sqlacodegen  --schema=<schema_name> --tables <table_name> 
postgresql://<user>:<password>@<host>


I am getting this error:
Traceback (most recent call last):
  File "***/bin/sqlacodegen", line 8, in <module>
    sys.exit(main())
  File "***/lib/python3.9/site-packages/sqlacodegen/main.py", line 51, in 
main
    generator = CodeGenerator(metadata, args.noindexes, args.noconstraints, 
args.nojoined,
  File "***/lib/python3.9/site-packages/sqlacodegen/codegen.py", line 437, 
in __init__
    model = self.class_model(table, links[table.name], self.inflect_engine,
  File "***/lib/python3.9/site-packages/sqlacodegen/codegen.py", line 201, 
in __init__
    super(ModelClass, self).__init__(table)
  File "***/lib/python3.9/site-packages/sqlacodegen/codegen.py", line 100, 
in __init__
    column.type = self._get_adapted_type(column.type, column.table.bind)
AttributeError: 'Table' object has no attribute 'bind'



Can you please advise?


-- 
--
NOTICE: This email and all attachments are confidential and may contain 
information that is privileged, confidential, or exempt from disclosure 
under law. If you are not the intended recipient, delete this message and 
notify the sender immediately. Any unauthorized use is strictly prohibited.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/1e1dd8cc-0cb6-4ffb-b808-094f26aa4a6en%40googlegroups.com.

Reply via email to