Replies: 5 comments 3 replies
-
Ok. I didn't encounter this problem, and I started with the latest SQLAlchemy. This seems to have been fixed in SQLAlchemy 2.0.8. The DataClassBase and Base options you provide make model definition easier. |
Beta Was this translation helpful? Give feedback.
-
I tested SQLAlchecmy 2.0.8, 2.0.9. This is an issue that won't be fixed, because SQLAlchemy works in its own dataclass model Create a new database, confirm your SQLAlchemy version, then perform the migration via alembic, or just start the service and you will find the exception |
Beta Was this translation helpful? Give feedback.
-
I missed the discussion at sqlalchemy/sqlalchemy#9333 I tested it, and it is indeed normal in 2.0.0b1, and there is no backward compatibility. So what's the new Mixin workaround? |
Beta Was this translation helpful? Give feedback.
-
Not yet. I‘ve been a little busy lately. What needs to be solved most is the field order problem of SQAlchemy data mode. We only need to ensure that the MiXin parameters are always arranged at the end of the subclass parameters when they are inherited, not the front. In this way, there will be no extra work. |
Beta Was this translation helpful? Give feedback.
-
When the Python interpreter parses the parameter list, it always parses the parameters in the order of the parent class first, and then the child class. Unless the fields of the parent class are overridden in the subclass, but that would be meaningless. |
Beta Was this translation helpful? Give feedback.
-
Hi, @downdawn
This issue needs to be fixed: I6GCQ7 to sqlalchemy/sqlalchemy#9333
I have to drop using SQLAlchemy-2.0.0b1, and upgrade to SQLAlchemy >= 2.0.8 for backwards compatibility.
Since I prefer to use
MappedAsDataclass
, I now have to retrofit MiXin to work properly, but please note that I cannot use any new features that are only available in python > 3.7Beta Was this translation helpful? Give feedback.
All reactions