omymodels icon indicating copy to clipboard operation
omymodels copied to clipboard

map varchar(n) to Field(..., max_length=n) when targeting a pydantic model type

Open faccini-bs opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. The pydantic BaseModel (as well as dataclasses) validate the data on instantiation

Describe the solution you'd like starting from FIELD1 VARCHAR(256) instead of generating field1: str generate field1: str = Field(..., max_length=256)

Additional context I like this project and think this is a step forward to make it more useful

faccini-bs avatar Feb 15 '23 13:02 faccini-bs