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

Generate Decimals using Decimal.js #21

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

SSmietana
Copy link
Contributor

Updates Decimal generation to match Prisma's use of the Decimal.js library

@luisrudge
Copy link
Owner

thanks for the PR. can you elaborate a bit more on why this change is needed?

@SSmietana
Copy link
Contributor Author

@luisrudge prisma uses Decimal.js to represent Decimal db types. The current implementation generates a hexadecimal value, which results in a Type Error due to this mismatch between the generated hexadecimal string value, and the expected Decimal value.

@SSmietana
Copy link
Contributor Author

@luisrudge any update on this, will this PR go forward?

@luisrudge
Copy link
Owner

Yes, I'm planning to merge it this week. I just wanna play around a bit. Not a big fan of adding the dependency since it might conflict with other projects already using this...

Also, this would be an issue with BigInt as well, since we're using faker.datatypes.int() instead of BigInt.

In the meantime, can you please make sure you update bun's lockfile? thanks!

@luisrudge luisrudge merged commit 956668d into luisrudge:main Jan 25, 2024
1 check passed
@luisrudge
Copy link
Owner

@SSmietana SSmietana deleted the generate-decimal-as-decimal branch September 6, 2024 17:42
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.

2 participants