MCPcopy Index your code
hub / github.com/clips/pattern / quote

Method quote

pattern/db/__init__.py:562–568  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

560 Booleans are converted to "0" and "1", None is converted to "null".
561 """
562 def quote(string):
563 # How to escape strings differs between database engines.
564 if self.type == MYSQL:
565 #return "'%s'" % self._connection.escape_string(string) # Doesn't like Unicode.
566 return "'%s'" % string.replace("'", "\\'")
567 if self.type == SQLITE:
568 return "'%s'" % string.replace("'", "''")
569 return _escape(value, quote)
570
571 def binary(self, data):

Callers 1

escapeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected