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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

quaint = {git = 'https://github.com/serejkaaa512/quaint/', branch = 'feature/unsigned_int' }
7 changes: 7 additions & 0 deletions libs/prisma-value/src/sql_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ impl<'a> TryFrom<Value<'a>> for PrismaValue {
let val = match pv {
Value::Integer(i) => i.map(PrismaValue::Int).unwrap_or(PrismaValue::Null),

Value::UnsignedInteger(Some(u)) => match i64::try_from(u) {
Ok(i) => PrismaValue::Int(i),
Err(_) => return Err(crate::ConversionFailure { from: "u64", to: "i64" }),
},

Value::UnsignedInteger(None) => PrismaValue::Null,

Value::Float(Some(f)) => match f {
f if f.is_nan() => {
return Err(crate::ConversionFailure {
Expand Down