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

Support dates in raw queries #835

Merged
merged 1 commit into from
Jun 22, 2020
Merged

Support dates in raw queries #835

merged 1 commit into from
Jun 22, 2020

Conversation

pimeys
Copy link
Contributor

@pimeys pimeys commented Jun 22, 2020

Addresses issue prisma/prisma#2533

This is the engines part of the issue and needs support from the client. To allow querying with dates, the user should pass a date object in the query, which client coerces into a JSON object, marking the type correctly:

{
  "prisma__type": "date",
  "prisma__value": "1996-12-19T16:39:57+00:00"
}

This gets then parsed as a DateTime, allowing its usage in the query parameters.

@pimeys pimeys added the kind/bug A reported bug. label Jun 22, 2020
@pimeys pimeys added this to the 2.1.0 milestone Jun 22, 2020
@pimeys pimeys self-assigned this Jun 22, 2020
Copy link
Contributor

@tomhoule tomhoule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@pimeys pimeys merged commit be6a8de into master Jun 22, 2020
@pimeys pimeys deleted the raw-date-fix branch June 22, 2020 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A reported bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants