本文整理匯總了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)