From 3d13ccda7cd80cf8236532f73fa34fe302462aa4 Mon Sep 17 00:00:00 2001 From: Nima Rahnema Date: Wed, 6 Sep 2023 15:38:54 +0000 Subject: [PATCH] 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`. --- pypika/dialects.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pypika/dialects.py b/pypika/dialects.py index 6e151d68..c053f410 100644 --- a/pypika/dialects.py +++ b/pypika/dialects.py @@ -856,7 +856,12 @@ class SQLLiteQueryBuilder(QueryBuilder): QUERY_CLS = SQLLiteQuery def __init__(self, **kwargs: Any) -> None: - super().__init__(dialect=Dialects.SQLLITE, wrapper_cls=SQLLiteValueWrapper, **kwargs) + super().__init__( + dialect=Dialects.SQLite, + wrap_set_operation_queries=False, + wrapper_cls=SQLiteValueWrapper, + **kwargs, + ) self._insert_or_replace = False @builder