MCPcopy
hub / github.com/psycopg/psycopg / _exec_command

Function _exec_command

tests/fix_db.py:293–300  ·  view source on GitHub ↗
(command, *args, **kwargs)

Source from the content-addressed store, hash-verified

291 L = ListPopAll()
292
293 def _exec_command(command, *args, **kwargs):
294 if isinstance((cmdcopy := command), bytes):
295 cmdcopy = cmdcopy.decode(conn.info.encoding)
296 elif isinstance(cmdcopy, sql.Composable):
297 cmdcopy = cmdcopy.as_string(conn)
298
299 L.append(cmdcopy)
300 return _orig_exec_command(command, *args, **kwargs)
301
302 monkeypatch.setattr(conn, "_exec_command", _exec_command)
303 return L

Callers

nothing calls this directly

Calls 1

as_stringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…