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)
Exemplo n.º 2
0
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))
Exemplo n.º 4
0
def DateTimeDelta2literal(d, c):
    """Format a DateTimeDelta object as a time."""
    return string_literal(format_TIMEDELTA(d))
Exemplo n.º 5
0
def Set2Str(s, d):
    # Only support ascii string.  Not tested.
    return string_literal(','.join(s))
Exemplo n.º 6
0
def DateTime2literal(d, c):
    """Format a DateTime object as an ISO timestamp."""
    return string_literal(format_TIMESTAMP(d))
Exemplo n.º 7
0
def DateTimeDelta2literal(d, c):
    """Format a DateTimeDelta object as a time."""
    return string_literal(format_TIMEDELTA(d))
Exemplo n.º 8
0
def DateTime2literal(d, c):
    """Format a DateTime object as an ISO timestamp."""
    return string_literal(format_TIMESTAMP(d))
Exemplo n.º 9
0
def _escape_string(s, d):
    return _mysql.string_literal(s.encode('utf-8')).decode('utf-8')
Exemplo n.º 10
0
def _escape_bytes(b, c):
    return _mysql.string_literal(b, c).decode('utf-8')