DT
Drizzle Teamyeehow
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 erroringY
yeehow•349d ago
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.Y
yeehow•348d ago
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 …
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.3KMembers
View on DiscordWant results from more Discord servers?
More PostsInfer return type for relational query with paginationI have created a function that can paginate data for relational queries, problem is i cant figure oHow to implement triggers or db hooks ?Is there a way to know if sql statement got executed successfully or not ? I wanted to run a code whnoob help: INSERT with JOIN SQL to DrizzleFrontend developer dabbling with SQL for the first time in years. With the help of ChatGPT I have thOrderBy with dynamic queries dont work```
....orderBy(sql`${products.xyz} ${order}`)
```
```
error: syntax error at or near "$2"
```
ordeIs there a way to limit update to just 1 document?I know there will be multiple documents matching this where query, but I only want to update 1 of thHow to get InferModel to work with Relation model?Is there a way to get the infer type for a relation model? eg:
type User = InferModel<typeof users,MySQL column type: "Generated"?Does drizzle support defining generated columns? https://planetscale.com/courses/mysql-for-developeAnyone else having a weird issue with drizzle-kit push:mysql?I spun up a new project using Planetscale and I got a bizarre __vtschema error (see: https://github.