SQLite uses CTE with SQS 2.1.1.

This commit is contained in:
mike12345567 2024-09-11 13:41:54 +01:00
parent 05de673781
commit c9b64e3591
1 changed files with 1 additions and 5 deletions

View File

@ -1212,12 +1212,8 @@ class InternalBuilder {
query = this.addFilters(query, filters, { relationship: true }) query = this.addFilters(query, filters, { relationship: true })
// SQLite (SQS) cannot use the WITH statement yet
if (relationships?.length && this.client === SqlClient.SQL_LITE) {
return this.addJsonRelationships(query, tableName, relationships)
}
// handle relationships with a CTE for all others // handle relationships with a CTE for all others
else if (relationships?.length) { if (relationships?.length) {
const mainTable = const mainTable =
this.query.tableAliases?.[this.query.endpoint.entityId] || this.query.tableAliases?.[this.query.endpoint.entityId] ||
this.query.endpoint.entityId this.query.endpoint.entityId