コード例 #1
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)
コード例 #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)
コード例 #3
0
def Set2Str(s, d):
    # Only support ascii string.  Not tested.
    return string_literal(",".join(s))
コード例 #4
0
ファイル: times.py プロジェクト: PyMySQL/mysqlclient-python
def DateTimeDelta2literal(d, c):
    """Format a DateTimeDelta object as a time."""
    return string_literal(format_TIMEDELTA(d))
コード例 #5
0
def Set2Str(s, d):
    # Only support ascii string.  Not tested.
    return string_literal(','.join(s))
コード例 #6
0
ファイル: times.py プロジェクト: PyMySQL/mysqlclient-python
def DateTime2literal(d, c):
    """Format a DateTime object as an ISO timestamp."""
    return string_literal(format_TIMESTAMP(d))
コード例 #7
0
def DateTimeDelta2literal(d, c):
    """Format a DateTimeDelta object as a time."""
    return string_literal(format_TIMEDELTA(d))
コード例 #8
0
def DateTime2literal(d, c):
    """Format a DateTime object as an ISO timestamp."""
    return string_literal(format_TIMESTAMP(d))
コード例 #9
0
def _escape_string(s, d):
    return _mysql.string_literal(s.encode('utf-8')).decode('utf-8')
コード例 #10
0
def _escape_bytes(b, c):
    return _mysql.string_literal(b, c).decode('utf-8')