pydantic-pycharm-plugin
pydantic-pycharm-plugin copied to clipboard
Add SQLModel support for pycharm
@masreplay Thank you for creating the issue. OK, I will check it.
This would be amazing!
Sqlmodel columns are inherited from sqlaclhemy and can be accessed before init is called, unlike pydantic models. When the plugin is applied, pycharm stops prompting. Also, pycharm does not suggest methods of sqlalchemy columns (in_, op, ...). Please add support for this
from sqlmodel import Field, SQLModel
class User(SQLModel, table=True):
name: str = Field(primary_key=True)
email: str
# first problem
print(User.name)
print(User.email)
# second problem
print(type(User.name.op), type(User.name.in_))