prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
583 stars 61 forks source link

feat: distinguish between `i32` and `i64` #355

Closed Weakky closed 2 years ago

Weakky commented 2 years ago

Overview

⚠️ DO NOT MERGE YET

Splits Value::Integer into two new variants: Value::Int32 and Value::Int64. SQLite does not honor this contract yet as this would break Prisma, which we want to postpone for Prisma 4. For now, SQLite always returns Int64 as it was already doing before.

You'll see a lot of TODOs in the tests which account for SQLite not returning i32 where expected. This work is tracked by https://github.com/prisma/prisma/issues/12784.

⚠️ For better readability, please read ace6d3d instead of the overall PR diff. cargo fmt prevents from having a clear diff, especially on conversion/postgres.rs

⚠️ Also, review the conversions carefully (FromSql & ToSql) as they might lead to unintended breaking changes in Prisma.

Changes