You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a PostgreSQL database, a JSON or JSONB column is converted to (with the dataclass output) col_name: Optional[dict] = field(default=None, metadata={'sa': Column(JSONB)}). Usually JSON/JSONB fields correspond to Python types that you get from json.dumps: nested list, dict, int, etc., not just dict.
The text was updated successfully, but these errors were encountered:
Sqlacodegen just uses whatever Python type comes from column.type.python_type. You should probably report this as a bug against SQLAlchemy itself. I recently got a similar issue fixed with a PR that implements python_type for the UUID column type.
In a PostgreSQL database, a JSON or JSONB column is converted to (with the dataclass output)
col_name: Optional[dict] = field(default=None, metadata={'sa': Column(JSONB)})
. Usually JSON/JSONB fields correspond to Python types that you get fromjson.dumps
: nested list, dict, int, etc., not justdict
.The text was updated successfully, but these errors were encountered: