`$with` example in docs error "unsupported: with expression in select statement"
I have a user with id of 42, just like the docs https://orm.drizzle.team/docs/crud#with-clause
but executing the same query throws an Error:
unsupported: with expression in select statement
The $with clause looks superb.Quering with SQL-like syntax [CRUD] – DrizzleORM
Drizzle ORM | %s
5 Replies
what database are you using?
I am using mysql via planetscale (sorry i'll mention next time)
Note: the nearly identical subquery (without the $with) in the docs right below the $with section does work.
https://orm.drizzle.team/docs/crud#select-from-subquery
Quering with SQL-like syntax [CRUD] – DrizzleORM
Drizzle ORM | %s
I guess it's because PlanetScale doesn't have a support for WITH statements
I guess @Dan Kochetov knows exactly
yes, CTEs are not supported on PS
Ah yes, I see now that error is from PlanetScale, not drizzle.
I should have searched first https://github.com/planetscale/discussion/discussions/270
Thanks to both 🙌
GitHub
unsupported: with expression in select statement · planetscale disc...
Hi, When running a recursive CTE, I get the following error message. unsupported: with expression in select statement Is PlanetScale able to or planning support recursive CTEs?