-
Notifications
You must be signed in to change notification settings - Fork 113
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
Prepared statement with IN(?)
does not work
#866
Comments
You just need to drop the parentheses around the question mark:
Otherwise, IIUC the The next release will do type checking before sending values to the DB and should have more helpful error messages. |
Thank you a lot! It works now. |
Are we missing an example perhaps? |
I wonder if the Rust driver could have detected that he's passing the wrong type for a bound variable, and refused to send the request instead of sending it and the server complaining in that unfriendly way. If I remember correctly, the Python driver has such checks. It often frustrates me when I write tests (because I can't send incorrect types to the server to check how the server handles them), but for real users - such client-side checks can be helpful as we see here. |
@mykaul The main issue here is that the CQL syntax for one-element tuples is confusing. It's not specific to the driver. Perhaps the meaning of Another thing is that the driver does not type check data before sending and the errors returned from the DB are confusing. This is being worked on and will be fixed in the next release (#463). The driver will report a message like:
While this does not suggest a solution, it at least points users in the right direction. |
@nyh Yes, it is possible. After preparing a statement, Scylla returns information about all of the bind markers, including their names and types. We intend to use it to implement type checking. |
@mykaul I think so, I have tried to find it, but couldn't. |
Please add an example somewhere. I ran into the same issue. There is no example in the docs or in the examples folder. The only way I could fix it, is by coming across this issue, which took many search attempts to get here. Thanks |
Sure, we can add an example - but primarly I'd like the error messages to be clear enough that users won't need to search the internet for the solution.
Apart from the obvious mistake in the last sentence (which we need to fix), it does say |
Code:
Error if
ck
issmallint
:Error if
ck
isint
:Error if
ck
isbigint
:Table:
What am I doing wrong? Or have it been always broken?
The text was updated successfully, but these errors were encountered: