-
Notifications
You must be signed in to change notification settings - Fork 303
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
Error: too many arguments on function JSON_OBJECT - π Bug Report β Runtime APIs #2412
Comments
This is almost certainly an error coming directly from sqlite. That is, you'd get the same error when running sqlite locally, independent of Workers. There probably isn't anything we can do about this, you would need to file an issue upstream with sqlite. |
@kentonv, nope, it works fine in SQLite otherwise I wouldn't of reported it. I literally used the .db file that is produced from D1 when using cloudflare proxy locally, and opening that in https://www.sqlitepro.com/ and running the same query produces no Error. |
Oh, come to think of it, I suppose it's probably from this: workerd/src/workerd/util/sqlite.c++ Line 812 in d46550a
Your invocation has 36 args, the limit is 32. https://www.sqlite.org/security.html actually recommends a limit of 8, but we increased it to 32 at some point. Is it possible to rephrase this code in a way that doesn't require so many args? We could maybe increase this further but I'm hesitant to diverge from the security recommendations too much. |
@kentonv that seems like a solid guess, here's a few things I've tried. 1. I removed the top level JSON_OBJECT function invocation and just do a simple anyway, I'm open to suggestions, just trying to find a nice way to do complex selects like this without too much massaging of the data. also using the JSON functions in SQL lite is a lot faster than manual manipulation in JS would you guys be willing to bump to 64? |
@kentonv bump |
Thank you @kentonv π |
trying to run the following with D1
produces the following error:
here's the schema:
The text was updated successfully, but these errors were encountered: