Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pypika/dialects.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ def __init__(self, **kwargs: Any) -> None:
super().__init__(dialect=Dialects.SQLLITE, wrapper_cls=SQLLiteValueWrapper, **kwargs)
self._insert_or_replace = False

_ignore_syntax = "OR IGNORE "

@builder
def insert_or_replace(self, *terms: Any) -> "SQLLiteQueryBuilder":
self._apply_terms(*terms)
Expand Down
4 changes: 3 additions & 1 deletion pypika/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1407,10 +1407,12 @@ def _select_sql(self, **kwargs: Any) -> str:
select=",".join(term.get_sql(with_alias=True, subquery=True, **kwargs) for term in self._selects),
)

_ignore_syntax = "IGNORE "

def _insert_sql(self, **kwargs: Any) -> str:
return "INSERT {ignore}INTO {table}".format(
table=self._insert_table.get_sql(**kwargs),
ignore="IGNORE " if self._ignore else "",
ignore=self._ignore_syntax if self._ignore else "",
)

def _replace_sql(self, **kwargs: Any) -> str:
Expand Down