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

[drift_postgres] Postgres implicit type casts not working in raw queries #2986

Closed
davidmartos96 opened this issue May 3, 2024 · 1 comment

Comments

@davidmartos96
Copy link
Contributor

Similar to #2981 this explicit casting can break valid Postgres queries.

For instance, passing a String to insert a INT8 column is valid in the postgres driver, but when forcing it to be always Type.text it will complain.

Should we let the values go through to the postgres package with unspecified typing?

@simolus3
Copy link
Owner

simolus3 commented May 3, 2024

I think this is working as intended for explicit variables added by drift. For others stumbling across this (e.g. for custom queries), a workaround is to use variables with a TypedValue from the postgres package that has its type set to Type.undefined. These values won't be modified by drift at all and can be used to signal that no explicit type is known.

(if it turns out that drift would benefit from not using explicit types as well, I'm happy to revisit this or perhaps make this an opt-in flag)

@simolus3 simolus3 closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants