Relational query erroring on workers + D1
Only able to get relation queries to work while running the worker in local mode.
While running remote (
--remote
) or deployed it errors
To be clear .findMany()
works remotely, but when adding a with
it starts erroring2 Replies
adding a
.catch
to the query shows this error. maybe this is more helpful?
Noticed that when including less columns the error goes away. Seems maybe the query is too long for D1?
Is there a way to do .toSQL()
with the new query
syntax?
Not too familiar with this stuff, but looks like SQLite has an argument limit for json_array
https://sqlite.org/forum/info/5e7d54021a100e7297b9548723875881556d4c6644fc8b316564df32d1a0023f
If I had to guess with D1 they have set a limit lower than standard sqlite. Which would explain why it runs fine locally, but doesn't remotely.Yeah that is what it was. Current function argument max at 8.
https://developers.cloudflare.com/d1/platform/limits/
On their discord they mentioned it would be bumped to 32 next week so that should solve my problems.
Limits · Cloudflare D1 docs
Many of these limits will increase during D1’s public alpha. Join the #d1-open-alpha channel in the Cloudflare Developer Discord to keep up to date …