本文整理汇总了Python中_mysql.string_literal方法的典型用法代码示例。如果您正苦于以下问题:Python _mysql.string_literal方法的具体用法?Python _mysql.string_literal怎么用?Python _mysql.string_literal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_mysql
的用法示例。
在下文中一共展示了_mysql.string_literal方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Set2Str
# 需要导入模块: import _mysql [as 别名]
# 或者: from _mysql import string_literal [as 别名]
def Set2Str(s, d):
return string_literal(','.join(s), d)
示例2: Thing2Literal
# 需要导入模块: import _mysql [as 别名]
# 或者: from _mysql import string_literal [as 别名]
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, d)
示例3: DateTime2literal
# 需要导入模块: import _mysql [as 别名]
# 或者: from _mysql import string_literal [as 别名]
def DateTime2literal(d, c):
"""Format a DateTime object as an ISO timestamp."""
return string_literal(format_TIMESTAMP(d),c)
示例4: DateTimeDelta2literal
# 需要导入模块: import _mysql [as 别名]
# 或者: from _mysql import string_literal [as 别名]
def DateTimeDelta2literal(d, c):
"""Format a DateTimeDelta object as a time."""
return string_literal(format_TIMEDELTA(d),c)
示例5: Thing2Literal
# 需要导入模块: import _mysql [as 别名]
# 或者: from _mysql import string_literal [as 别名]
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, d)
示例6: DateTime2literal
# 需要导入模块: import _mysql [as 别名]
# 或者: from _mysql import string_literal [as 别名]
def DateTime2literal(d, c):
"""Format a DateTime object as an ISO timestamp."""
return string_literal(format_TIMESTAMP(d), c)