Open NixBiks opened 10 months ago
I see this as well. In order to fix broken code, I had to manually add the "metadata" variable to all association tables that didn't have primary keys - that's the bug with the double commas. After that, it works in 3.0.0rc3.
It's not supposed to use mapped_column
at all. All the tests expect that it uses Column()
and not mapped_column()
. The latter is a thing only on SQLAlchemy 2. Before sqlmodel
0.0.12 (released 7 hours ago), it didn't even work with SQLAlchemy 2 at all.
I'm pretty sure that this was caused by `sqlmodel now supporting SQLAlchemy 2, and sqlacodegen wasn't ready for that.
I'm pretty sure that this was caused by `sqlmodel now supporting SQLAlchemy 2, and sqlacodegen wasn't ready for that.
Thank you for the information!
After that, I used an environment with SQLAlchemy < 2 and it worked!
conda create --name sqlacodegen-py39 -c conda-forge python=3.9 sqlacodegen==3.0.0rc3 sqlalchemy==1.4.51 pymssql==2.2.7
Now the mapped_column no longer appears, as it is not yet compatible with SQLModel
This issue still exists in rc5, which still includes mapped_column. I replaced mapped_column with sqlmodel.Column, You can work normally now.
This issue still exists in rc5, which still includes mapped_column. I replaced mapped_column with sqlmodel.Column, You can work normally now.
Things to check first
[X] I have searched the existing issues and didn't find my bug already reported there
[X] I have checked that my bug is still present in the latest release
Sqlacodegen version
3.0.0rc3
SQLAlchemy version
2.0.23
RDBMS vendor
PostgreSQL
What happened?
The screenshot shows some of the issues.
mapped_column
.,
in line 22.Database schema for reproducing the bug