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

driver-adapters: convert Decimals to Strings when calling JS #4408

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

SevInf
Copy link
Contributor

@SevInf SevInf commented Nov 2, 2023

When forwarding the input to the driver adapter, we used to convert
decimal values to f64. On a large numbers, that lost some precision.
Changing this to convert them to strings instead.

Fix prisma/team-orm#497

TODO: after this gets to the client, unskip decimal/presion test
there.

@SevInf SevInf requested a review from a team as a code owner November 2, 2023 11:11
@SevInf SevInf requested review from miguelff and jkomyno and removed request for a team November 2, 2023 11:11
When forwarding the input to the driver adapter, we used to convert
decimal values to f64. On a large numbers, that lost some precision.
Changing this to convert them to strings instead.

Fix prisma/team-orm#497

TODO: after this gets to the client, unskip `decimal/presion` test
there.
@SevInf SevInf force-pushed the fix/decimal-precision branch from 7c2d6bf to 246e0ce Compare November 2, 2023 11:12
@SevInf SevInf added this to the 5.6.0 milestone Nov 2, 2023
@SevInf SevInf changed the title driver-adapters: Read Decimals as Strings driver-adapters: convert Decimals to Strings when calling JS Nov 2, 2023
Copy link

codspeed-hq bot commented Nov 2, 2023

CodSpeed Performance Report

Merging #4408 will not alter performance

Comparing fix/decimal-precision (25a1f51) with main (82dc77d)

Summary

✅ 11 untouched benchmarks

@jkomyno
Copy link
Contributor

jkomyno commented Nov 2, 2023

Trying this PR locally, I verified that decimal/precision can indeed be skipped in functional Client tests.
Let's see if we can achieve this without breaking LibSQL. Remember: we might just add custom logic to the Driver Adapter to simplify our Rust logic (that was our original goal, I'm not sure whether that's still what we're pursuing though)

@SevInf
Copy link
Contributor Author

SevInf commented Nov 2, 2023

Libsql is now fixed (to the extend it works on main, so 2 failed test)

@SevInf SevInf merged commit 575e022 into main Nov 3, 2023
27 of 31 checks passed
@SevInf SevInf deleted the fix/decimal-precision branch November 3, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants