-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Dates serialized without quotation marks in query event parameters property #6578
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hello @matthewmueller same issue here.. :( @ssukienn did you find a workaround? |
I wasn't testing new Prisma versions for this bug and I no longer need it (a fix would be appreciated though) but as in the main post what you could do is reconcile with replacing ISO date or just format regex (plus delimiters) with captured value and enclosing quotation/delimiters like It is error-prone though and relies on the Prisma internals plus it would be worth checking how Prisma is encoding cases where certain string parameter is something like |
Or simple |
The arguments are serialized on the engine side, client just forwards this string as-is |
- Certain types, `Date`, `DateTime`, `Xml`, `UUID`, `Time` are displayed as quoted values in logging messages - This is part of fix for prisma/prisma#6578
* Display parameters for certain types is done correctly - Certain types, `Date`, `DateTime`, `Xml`, `UUID`, `Time` are displayed as quoted values in logging messages - This is part of fix for prisma/prisma#6578
Bug description
The dates in Prisma query event
parameters
property are serialized without"
making it impossible to parse is as JSON out of the box.Example:
["DRAFT","test-tenant-uuid","ONGOING","SCHEDULED","COMPLETED",2021-04-14 13:25:26.778 UTC,2021-04-14 13:25:26.779 UTC,101,0]
. String values are enclosed with"
, numbers naturally are not (but it is fine). With dates on the other hand it is not okay. If normal literal values are enclosed why not dates if they are stored in a property of typestring
. Additionally in SQL queries Date type columns are comparable with string representation.How to reproduce
Expected behavior
Well, keeping the parameters in an array serialized to string is problematic in the first place but it wouldn't be a problem if we could parse it as a JSON, and I expected that it is always possible. If not and it is okay, is it really expected here to fix it by hand using string regexes/split/joins etc?
My use case here is that I am developing pretty debug log of the queries which can executed on the db 1:1.
Prisma information
Not relevant.
Environment & setup
Internal Slack Thread
The text was updated successfully, but these errors were encountered: