Skip to content
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

Add support for CAST to convert between types #1010

Closed
dantownsend opened this issue Jun 7, 2024 · 0 comments · Fixed by #1011
Closed

Add support for CAST to convert between types #1010

dantownsend opened this issue Jun 7, 2024 · 0 comments · Fixed by #1011
Labels
enhancement New feature or request

Comments

@dantownsend
Copy link
Member

There are situations where being able to cast a value to a different type is very useful.

Here we can convert a timestamp to a time:

>>> await Concert.select(
...     Cast(Concert.starts, Time(), "start_time")
... )
[{"start_time": datetime.time(19, 0)}]

In certain (fairly rare) situations, we need to explicitly specify the type of a value in queries, which cast will also help with.

@dantownsend dantownsend added the enhancement New feature or request label Jun 7, 2024
@dantownsend dantownsend added this to To do in Enhancements via automation Jun 7, 2024
Enhancements automation moved this from To do to Done Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant