-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix(#634): added a generate function to support SQL Numeric field #636
base: main
Are you sure you want to change the base?
fix(#634): added a generate function to support SQL Numeric field #636
Conversation
Based on examples and docs linked, from Pydantic
and Postgres docs
how do these differ? Is this for trailing zero handling? Based on failing example from issue it looks like an issue in generating the values themselves. Would this fix or similar apply to decimal handling too? |
Hi @adhtruong and thanks for reviewing! The main thing I have done in last commits:
|
Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/636 |
Description
I have decided to add a new separate function to work with only SQL NUMERIC type like this, because Pydantic Decimal Constraints works in a slightly different way.
Also this function does not allow to use a negative scale and a scale larger than the declared precision. This can be used only with the SQL standard requirements (the scale must be in the range 0 to precision). And generated values can be either positive or negative.
Closes