MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_dialect_specific_sql

Method test_dialect_specific_sql

test/sql/test_compiler.py:6424–6442  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6422 )
6423
6424 def test_dialect_specific_sql(self):
6425 my_table = table(
6426 "my_table", column("id"), column("data"), column("user_email")
6427 )
6428
6429 from sqlalchemy.dialects.postgresql import insert
6430
6431 insert_stmt = insert(my_table).values(
6432 id="some_existing_id", data="inserted value"
6433 )
6434
6435 do_update_stmt = insert_stmt.on_conflict_do_update(
6436 index_elements=["id"], set_=dict(data="updated value")
6437 )
6438 eq_ignore_whitespace(
6439 str(do_update_stmt),
6440 "INSERT INTO my_table (id, data) VALUES (%(id)s, %(data)s) "
6441 "ON CONFLICT (id) DO UPDATE SET data = %(param_1)s",
6442 )
6443
6444 def test_dialect_specific_ddl(self):
6445 from sqlalchemy.dialects.postgresql import ExcludeConstraint

Callers

nothing calls this directly

Calls 6

tableFunction · 0.90
columnFunction · 0.90
insertFunction · 0.90
eq_ignore_whitespaceFunction · 0.90
valuesMethod · 0.45
on_conflict_do_updateMethod · 0.45

Tested by

no test coverage detected