-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Ilchuk
committed
Jan 9, 2024
1 parent
d413ef3
commit 7df2cb1
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Any | ||
from typing import Optional | ||
from typing import Union | ||
|
||
import sqlalchemy as sa | ||
|
||
|
||
class Upsert(sa.sql.Insert): | ||
__visit_name__ = "upsert" | ||
_propagate_attrs = {"compile_state_plugin": "yql"} | ||
|
||
def compile( | ||
self, | ||
bind=None, | ||
dialect=None, | ||
**kw: Any, | ||
): | ||
return super(Upsert, self).compile(bind, **kw) | ||
|
||
|
||
@sa.sql.base.CompileState.plugin_for("yql", "upsert") | ||
class InsertDMLState(sa.sql.dml.InsertDMLState): | ||
pass |