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
Feature request: checkNumberRange: boolean
#201
Comments
|
Right, i think that can be a nice addition to and a very practical option. |
…rtIdAsNumber/decimalAsNumber/bigIntAsNumber #201
…rtIdAsNumber/decimalAsNumber/bigIntAsNumber #201
…rtIdAsNumber/decimalAsNumber/bigIntAsNumber #201
|
closing, since done in develop branch and will be part of 3.0.1 |
|
Thank you for the feature! I think you forget to add the new option to types: |
BigIntas a safe default is good, but I often find it quite impractical, becausemariadbreturns BIGINT from various operations likeCOUNT(*)orcol + 1(noteCAST(aBigInt AS INT)still results in BIGINT).At the moment we can either choose to use the default safe behavior, but then we have to check the range and cast these to
numbermanually or we can usebigIntAsNumber: truefor convinience, but risk an invalid behavior in edge cases.I propose introducing a new option, which would provide conviniency, but would fail loudly in case of possible error:
checkNumberRange: booleanWhen set to
true, the driver throws an error if DECIMAL/BIGINT can't be converted safely tonumber.The option is only effective when one of
insertIdAsNumber/decimalAsNumber/bigIntAsNumberistrue.Defaults to
falsefor BC reasons.The text was updated successfully, but these errors were encountered: