[sqlalchemy] How to declare ORM class with index that in postgress is created with GREATEST

2023-03-13 Thread Yoav Kopfstein
Hi, I would like to declare an index in orm class with sqlalchemy 1.4 The index is created in postgres with this command: create index index_name on table_name (GREATEST(field_1, field_2)); how can I do it? (with __table_args__ or without ) thanks -- -- NOTICE: This email and all attach

[sqlalchemy] sqlacodegen error : AttributeError: 'Table' object has no attribute 'bind'

2023-02-22 Thread Yoav Kopfstein
I am using sqlacodegen for the first time to generate Python class models from an existing PostgreSQL database. when running this : % sqlacodegen --schema= --tables postgresql://:@ I am getting this error: Traceback (most recent call last): File "***/bin/sqlacodegen", line 8, in sys.