-
Notifications
You must be signed in to change notification settings - Fork 1.4k
query_as!() gives an error for a non-existing column for an expression #3806
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
Comments
@zbrox that is not a sufficiently minimal example. There's no table schema, nor a definition for |
You are right, I'm sorry, I have omitted this in haste. I will edit the report. |
@zbrox Any updates? I'm also working through some hiccups with pgvector and pgvector-rust. I'll try to take a look. Maybe we can help each other out. |
@xpe No, nothing new. To work around it quickly I just use it as an Option and then force unwrap it with an expect, knowing that it will always have a value. Not great, but for now it works. I had to move on quickly from this, I didn't have much time unfortunately. |
@zbrox You probably already know this, but just in case you don't: there is a lot of detailed documentation about SQLx to be found around option handling. For example: https://docs.rs/sqlx/latest/sqlx/macro.query.html#overrides-cheatsheet ![]() I refer to that that doc.rs page frequently when I find myself in trouble. |
Uh oh!
There was an error while loading. Please reload this page.
I have found these related issues/pull requests
I haven't found similar issues
Description
Hey,
I've been using the
query_as!
macro with an expression, doing a similarity search with pgvector.Here's an example:
With this I get the error
column "score" does not exist
. If I remove the type casting and just specify it as "score" then I get an error because it cannot convert it from an Option.Reproduction steps
The minimal example above should reproduce the error.
I'm using pgvector 0.4.0.
SQLx version
0.8.3
Enabled SQLx features
"runtime-tokio", "chrono", "uuid", "postgres", "migrate", "derive"
Database server and version
Postgres 17
Operating system
macos 15.3.2
Rust version
1.85.1
The text was updated successfully, but these errors were encountered: