You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using DrizzleORM to perform a relational query with TiDB, SQL containing LEFT JOIN LATERAL is automatically generated, leading to a syntax error in TiDB. Since TiDB does not support LATERAL joins, the query fails.
Undesired Behavior
Starting from [email protected], DrizzleORM generates LEFT JOIN LATERAL in relational query SQL. However, this syntax is not supported by TiDB, causing a syntax error.
inaridiy
changed the title
[BUG]: ORM generates unsupported LEFT JOIN LATERAL queries for TiDB, causing SyntaxError
[BUG]: TiDB Driver Generates Unsupported LEFT JOIN LATERAL Queries in Relational Query
Nov 26, 2024
It would be good to change the last argument of TiDBServerlessDatabase from default to plansclae. I'm using the forced replacement for now, but it works fine.
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.35.3
What version of
drizzle-kit
are you using?0.26.2
Other packages
@tidbcloud/[email protected]
Describe the Bug
When using DrizzleORM to perform a relational query with TiDB, SQL containing LEFT JOIN LATERAL is automatically generated, leading to a syntax error in TiDB. Since TiDB does not support LATERAL joins, the query fails.
Undesired Behavior
Starting from [email protected], DrizzleORM generates LEFT JOIN LATERAL in relational query SQL. However, this syntax is not supported by TiDB, causing a syntax error.
Reference: DrizzleORM v0.28.0 release notes
Expected Behavior
For TiDB, queries should be generated without using LEFT JOIN LATERAL, similar to how the MySQL2 driver operates in Planetscale mode.
I think it might be a good idea to enable Planetscale mode in the TiDB driver internally, but I'm not sure. I am just now calling mysql-core code!
The text was updated successfully, but these errors were encountered: