MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_compiled_insert_execute

Method test_compiled_insert_execute

test/sql/test_query.py:284–295  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

282 eq_(connection.execute(s, dict(id=7)).first()._mapping["user_id"], 7)
283
284 def test_compiled_insert_execute(self, connection):
285 users = self.tables.users
286 connection.execute(
287 users.insert().compile(connection),
288 dict(user_id=7, user_name="jack"),
289 )
290 s = (
291 select(users)
292 .where(users.c.user_id == bindparam("id"))
293 .compile(connection)
294 )
295 eq_(connection.execute(s, dict(id=7)).first()._mapping["user_id"], 7)
296
297 def test_repeated_bindparams(self, connection):
298 """Tests that a BindParam can be used more than once.

Callers

nothing calls this directly

Calls 8

selectFunction · 0.90
bindparamFunction · 0.90
eq_Function · 0.90
executeMethod · 0.45
compileMethod · 0.45
insertMethod · 0.45
whereMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected