pydantic-sqlalchemy
pydantic-sqlalchemy copied to clipboard
Tools to convert SQLAlchemy models to Pydantic models
sqlacodegen is a tool which reads the structure of an existing database and generates the appropriate SQLAlchemy model code: https://github.com/agronholm/sqlacodegen So if pyantic-sqlalchemy could work with this pacakge - it...
### How to reproduce I used a `TypeDecorator` SQLAlchemy class (see _uuid_type.py_ below) to create a handler of python `uuid.UUID` for SQLAlchemy, inspired by [sqlalchemy_utils.types.uuid.UUIDType](https://github.com/kvesteri/sqlalchemy-utils/blob/master/sqlalchemy_utils/types/uuid.py) and providing a dialect agnostic...
The required input from the user is a nested json, ``` {'customer_no': 2, 'subscriber': [{'subscriber_no': 2, 'is_active': False}, {'subscriber_no': 1, 'is_active': False}]} ``` Expected: sqlalachamy ORM will break this json...
This PR adds support for attributes defined by `@property` or `@hybrid_property`. The corresponding functions must provide a type hint for the return type. I'm not sure if I identify hybrid_properties...
Similar to the exclude parameter of sqlalchemy_to_pydantic(), it would be useful to be alternately able to specify an include list of columns. This would be convenient when we have a...
` class User(db.Model): __tablename__ = 'user' id = db.Column(db.Integer, autoincrement=True, primary_key=True) first_name = db.Column(db.String(40), nullable=False) last_name = db.Column(db.String(40), nullable=False) UserSchema = sqlalchemy_to_pydantic(User, exclude=['id']) UserSchema doesn't enforce the maximum length on...
fix a bug : #24](https://github.com/tiangolo/pydantic-sqlalchemy/issues/24)
Sometimes, when I use `sqlalchemy_to_pydantic` to create pydantic model, I want to make some columns and all columns to be optional for a patch requst.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start)...