def Thing2Literal(o, d): """Convert something into a SQL string literal. If using MySQL-3.23 or newer, string_literal() is a method of the _mysql.MYSQL object, and this function will be overridden with that method when the connection is created.""" return string_literal(o)
def Set2Str(s, d): # Only support ascii string. Not tested. return string_literal(",".join(s))
def DateTimeDelta2literal(d, c): """Format a DateTimeDelta object as a time.""" return string_literal(format_TIMEDELTA(d))
def Set2Str(s, d): # Only support ascii string. Not tested. return string_literal(','.join(s))
def DateTime2literal(d, c): """Format a DateTime object as an ISO timestamp.""" return string_literal(format_TIMESTAMP(d))
def _escape_string(s, d): return _mysql.string_literal(s.encode('utf-8')).decode('utf-8')
def _escape_bytes(b, c): return _mysql.string_literal(b, c).decode('utf-8')