json2python-models icon indicating copy to clipboard operation
json2python-models copied to clipboard

SQLModel support

Open izzues opened this issue 3 years ago • 1 comments

Thanks for your work!

SQLModel models are built on top of and compatible with Pydantic and SQLAlchemy, which avoids code duplication. Are there any plans to support it as output? Or any automated way to convert from one of the currently supported outputs to it?

izzues avatar Sep 13 '22 01:09 izzues

I'm not familiar with SQLModel and do not have plans for it, but looks like it will require only some templates changes at https://github.com/bogdandm/json2python-models/blob/master/json_to_models/models/pydantic.py#L23 (by inheritance PydanticModelCodeGenerator or creating some base class for them).

bogdandm avatar Sep 13 '22 09:09 bogdandm

Added in v0.3.0 (basic support, relationships and fk are not supported)

bogdandm avatar Jan 02 '23 12:01 bogdandm