pydantic-pycharm-plugin icon indicating copy to clipboard operation
pydantic-pycharm-plugin copied to clipboard

Add SQLModel support for pycharm

Open masreplay opened this issue 3 years ago • 3 comments

Can you please add support for SQLModel class which is inherited from Pydantic

masreplay avatar Jan 04 '22 10:01 masreplay

@masreplay Thank you for creating the issue. OK, I will check it.

koxudaxi avatar Jan 14 '22 01:01 koxudaxi

This would be amazing!

javivdm avatar Mar 09 '22 15:03 javivdm

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_))

fozt avatar May 06 '22 15:05 fozt