Skip to content

Add support for specifying column type. #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

tasn
Copy link

@tasn tasn commented Sep 23, 2021

Instead of having to set the whole column, we can just override the type
of the field itself. This works much nicer with the rest of sqlmodel.

Instead of having to set the whole column, we can just override the type
of the field itself.

Additionally, we allow fields to have a custom type so that it's easier
to just have blanket support for conversion of types without having to
specify on specific fields.

This works much nicer with the rest of sqlmodel.
@tiangolo
Copy link
Member

Nice! Could you write a test for this?

@tasn
Copy link
Author

tasn commented Aug 28, 2022

Sorry, it's been a year since the PR was opened, I've moved to other things and I don't have time to deal with this anymore.

@tiangolo
Copy link
Member

Thanks @tasn!

This is now possible with sa_type: #505

It will be available in the next version, 0.0.11. 🎉

Given that I'll close this one, but thanks for the effort! ☕

Note: I'll add tests and docs for that later, after adding support for SQLAlchemy 2.0 and Pydantic 2.0.

@tiangolo tiangolo closed this Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants