Skip to content

Commit 3d13ccd

Browse files
committed
Fix: Don't wrap set operations in brackets in SQLite
SQLite doesn't support set operations with brackets. Luckily there already exists this flag to disable adding brackets to set operations - enable for `SQLLiteQueryBuilder`.
1 parent 30574f9 commit 3d13ccd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pypika/dialects.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,12 @@ class SQLLiteQueryBuilder(QueryBuilder):
856856
QUERY_CLS = SQLLiteQuery
857857

858858
def __init__(self, **kwargs: Any) -> None:
859-
super().__init__(dialect=Dialects.SQLLITE, wrapper_cls=SQLLiteValueWrapper, **kwargs)
859+
super().__init__(
860+
dialect=Dialects.SQLite,
861+
wrap_set_operation_queries=False,
862+
wrapper_cls=SQLiteValueWrapper,
863+
**kwargs,
864+
)
860865
self._insert_or_replace = False
861866

862867
@builder

0 commit comments

Comments
 (0)