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

support unsigned int type #2459

Closed
wants to merge 1 commit into from
Closed

Conversation

garrensmith
Copy link
Contributor

@garrensmith garrensmith commented Dec 1, 2021

this work is based off the work in the quaint project prisma/quaint#335
It is not ready to be merged until the quaint PR has been merged.

At this stage we don't really support unsigned integers so we try and convert it to a signed int. An error is returned if that fails.

Copy link
Contributor

@pimeys pimeys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some validation of input values, so fail gracefully if giving negative values from the client.

@@ -48,3 +48,6 @@ opt-level = 3
codegen-units = 1
opt-level = 'z' # Optimize for size.
#strip="symbols"

[patch."https://github.com/prisma/quaint"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder to remove this before merging

@@ -273,6 +273,7 @@ impl<'a> LowerDmlToAst<'a> {
PrismaValue::Float(value) => ast::Expression::NumericValue(value.to_string(), ast::Span::empty()),
PrismaValue::Int(value) => ast::Expression::NumericValue(value.to_string(), ast::Span::empty()),
PrismaValue::BigInt(value) => ast::Expression::NumericValue(value.to_string(), ast::Span::empty()),
PrismaValue::UnsignedInt(value) => ast::Expression::NumericValue(value.to_string(), ast::Span::empty()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UInt, but choose whatever you wish.

@garrensmith garrensmith force-pushed the unsigned-integer-support branch from 68d22eb to 7c4f5e7 Compare December 3, 2021 12:57
@dpetrick
Copy link
Contributor

dpetrick commented Dec 3, 2021

Some validation of input values, so fail gracefully if giving negative values from the client.

The QE has no idea about native types, we can't validate that.

@do4gr do4gr closed this Aug 18, 2022
@janpio janpio deleted the unsigned-integer-support branch November 15, 2023 19:27
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.

4 participants