Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Cockroach Native Query problem (#664)
### What Native query tracking fails for CockroachDB because OIDs are 64-bit (despite what the documentation says). However, if we just change the type to `i64`, then the vanilla Postgres native query setup fails because `sqlx` requires each type in Rust to correspond to a specific Postgres type, and thus we can't do some sort of dynamic switching. ### How We cast absolutely everything to `i64` explicitly in the query. The fact that this works seems to be accidental: because the input type becomes irrelevant, Cockroach determines a different type for `oid` than Postgres, and both are happy. `sqlx` bases its types on information from the database, so it's also happy. I have tested this with tracking a native query in both Cockroach and Postgres, and both seem to be happy.
- Loading branch information