MCPcopy Create free account
hub / github.com/PyMySQL/mysqlclient / mogrify

Method mogrify

src/MySQLdb/cursors.py:206–218  ·  view source on GitHub ↗

Return query after binding args. query -- string, query to mogrify args -- optional sequence or mapping, parameters to use with query. Note: If args is a sequence, then %s must be used as the parameter placeholder in the query. If a mapping is used, %(key)s

(self, query, args=None)

Source from the content-addressed store, hash-verified

204 return query
205
206 def mogrify(self, query, args=None):
207 """Return query after binding args.
208
209 query -- string, query to mogrify
210 args -- optional sequence or mapping, parameters to use with query.
211
212 Note: If args is a sequence, then %s must be used as the
213 parameter placeholder in the query. If a mapping is used,
214 %(key)s must be used as the placeholder.
215
216 Returns string representing query that would be executed by the server
217 """
218 return self._mogrify(query, args).decode(self._get_db().encoding)
219
220 def executemany(self, query, args):
221 # type: (str, list) -> int

Callers 3

Calls 2

_mogrifyMethod · 0.95
_get_dbMethod · 0.95

Tested by 3