Open kj3moraes opened 1 month ago
In order to do partial updates, upserts and adds all in the same app, we would need to seperate just like how SQLModel seperates its BaseModels here
# Code above omitted 👆 class HeroBase(SQLModel): name: str = Field(index=True) secret_name: str age: int | None = Field(default=None, index=True) class Hero(HeroBase, table=True): id: int | None = Field(default=None, primary_key=True) class HeroCreate(HeroBase): pass class HeroPublic(HeroBase): id: int class HeroUpdate(SQLModel): name: str | None = None secret_name: str | None = None age: int | None = None # Code below omitted 👇
I really don't like this approach because there's so much clutter and boilerplate code. I will have to look at workarounds.
In order to do partial updates, upserts and adds all in the same app, we would need to seperate just like how SQLModel seperates its BaseModels here