-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
self.param_types.len() <= (i16::MAX as usize) should change to u16::MAX #671
Comments
I have another smaller struct using the same pattern like above which succeeds.
I'm transiting from diesel-rs. In diesel I need to enable a feature called |
Oh, I debugged and found the problem. It's the PARSE command's parameter length being too long. |
So this is actually due to ambiguous documentation. We're also not the only ones to make the same mistake. The Postgres JDBC driver appears to cap the parameter count at jOOQ/jOOQ#5701 The Postgres protocol documentation specifies that the bind parameter count is an https://www.postgresql.org/docs/current/protocol-message-types.html The functions in https://www.postgresql.org/docs/current/libpq-exec.html You have to dig into the implementation to find this assertion: https://github.com/postgres/postgres/blob/7559d8ebfa11d98728e816f6b655582ce41150f3/src/interfaces/libpq/fe-exec.c#L1304 |
Closed by #1141 |
I was checking Postgres' query parser to see if it placed a stricter limit on the value since I found that other databases are a little weird when it comes to bind parameter limits (SQLite is 32766 since the 1-based index must fit in a 2-byte signed integer), but the parser also just represents the index as an and simply uses |
I'm using postgresql, sqlx="0.4.0-beta.1".
My struct is like:
My query string is like:
I'm using this method to get results:
This assertion fails:
what's the problem here?
The text was updated successfully, but these errors were encountered: