MCPcopy
hub / github.com/psycopg/psycopg / mogrify

Method mogrify

psycopg/psycopg/client_cursor.py:36–46  ·  view source on GitHub ↗

Return the query and parameters merged. Parameters are adapted and merged to the query the same way that `!execute()` would do.

(self, query: Query, params: Params | None = None)

Source from the content-addressed store, hash-verified

34 _query_cls = PostgresClientQuery
35
36 def mogrify(self, query: Query, params: Params | None = None) -> str:
37 """
38 Return the query and parameters merged.
39
40 Parameters are adapted and merged to the query the same way that
41 `!execute()` would do.
42
43 """
44 self._tx = adapt.Transformer(self)
45 pgq = self._convert_query(query, params)
46 return pgq.query.decode(self._tx.encoding)
47
48 def _execute_send(
49 self,

Callers 7

test_mogrifyFunction · 0.80
test_mogrify_encodingFunction · 0.80
test_mogrify_badencFunction · 0.80
test_mogrifyFunction · 0.80
test_mogrify_encodingFunction · 0.80
test_mogrify_badencFunction · 0.80
test_mogrifyFunction · 0.80

Calls 1

_convert_queryMethod · 0.80

Tested by 7

test_mogrifyFunction · 0.64
test_mogrify_encodingFunction · 0.64
test_mogrify_badencFunction · 0.64
test_mogrifyFunction · 0.64
test_mogrify_encodingFunction · 0.64
test_mogrify_badencFunction · 0.64
test_mogrifyFunction · 0.64