MCPcopy
hub / github.com/psycopg/psycopg / insert_row

Function insert_row

tests/_test_transaction.py:24–34  ·  view source on GitHub ↗
(conn, value)

Source from the content-addressed store, hash-verified

22
23
24def insert_row(conn, value):
25 sql = "INSERT INTO test_table VALUES (%s)"
26 if isinstance(conn, psycopg.Connection):
27 conn.cursor().execute(sql, (value,))
28 else:
29
30 async def f():
31 cur = conn.cursor()
32 await cur.execute(sql, (value,))
33
34 return f()
35
36
37def inserted(conn):

Calls 3

fFunction · 0.70
executeMethod · 0.45
cursorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…