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

Feature request: throw error when prepared statement requires more parameters than the DB can handle #3929

Open
capaj opened this issue Jul 16, 2020 · 1 comment

Comments

@capaj
Copy link
Contributor

capaj commented Jul 16, 2020

many DBs don't handle this very nicely-their error messages are a bit confusing at times. Like for example when using 66364 parameters with postgre we get:

bind message supplies 828 parameters, but prepared statement "" requires 66364

unless you're a seasoned developer you can get quite confused by this.

Also knex doesn't support that many DBs, so maybe it would be worth to just adding limits like this:

sqlite: 999
oracle: 64000
postgre/mysql: 65535

and when user is trying to use more parameters just throw an error?

@elhigu
Copy link
Member

elhigu commented Jul 16, 2020

Are you sure that those numbers cannot be configured and are not changing between db versions? I’d rather would leave this error to be handled by db, like max statement length etc. Maybe some db error wrapper like objection has can catch and interpret this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants