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
I used the GitHub search to find a similar issue and didn't find it.
I searched the SQLModel documentation, with the integrated search.
I already searched in Google "How to X in SQLModel" and didn't find any information.
I already read and followed all the tutorial in the docs and didn't find an answer.
I already checked if it is not related to SQLModel but to Pydantic.
I already checked if it is not related to SQLModel but to SQLAlchemy.
Commit to Help
I commit to help with one of those options 👆
Example Code
fromsqlalchemyimportColumn, Integerfromsqlalchemy.ext.declarativeimportdeclarative_basefromsqlmodelimportSQLModel, FieldfrompydanticimportBaseModel# This doesn't work. It produces: # metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases# Base = declarative_base(cls=BaseModel)Base=declarative_base()
classModelBase(Base):
__abstract__=Truedefdo_something(self):
passclassMyOldModel(ModelBase):
id=Column(Integer, primary_key=True)
# This doesn't work (has no attribute '__config__')# class MyNewModel(ModelBase, SQLModel):# id: int = Field(primary_key=True)
Description
I'm working with a large codebase that needs to be migrated piecemeal. Is it possible to mix sqlalchemy and sqlmodel base classes?
Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.5
Python Version
Python 3.9.9
Additional Context
No response
The text was updated successfully, but these errors were encountered:
First Check
Commit to Help
Example Code
Description
I'm working with a large codebase that needs to be migrated piecemeal. Is it possible to mix sqlalchemy and sqlmodel base classes?
Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.5
Python Version
Python 3.9.9
Additional Context
No response
The text was updated successfully, but these errors were encountered: