本文整理匯總了Python中sqlalchemy.sql.visitors.Visitable方法的典型用法代碼示例。如果您正苦於以下問題:Python visitors.Visitable方法的具體用法?Python visitors.Visitable怎麽用?Python visitors.Visitable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sqlalchemy.sql.visitors
的用法示例。
在下文中一共展示了visitors.Visitable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _offset_or_limit_clause
# 需要導入模塊: from sqlalchemy.sql import visitors [as 別名]
# 或者: from sqlalchemy.sql.visitors import Visitable [as 別名]
def _offset_or_limit_clause(element, name=None, type_=None):
"""Convert the given value to an "offset or limit" clause.
This handles incoming integers and converts to an expression; if
an expression is already given, it is passed through.
"""
if element is None:
return None
elif hasattr(element, '__clause_element__'):
return element.__clause_element__()
elif isinstance(element, Visitable):
return element
else:
value = util.asint(element)
return _OffsetLimitParam(name, value, type_=type_, unique=True)
示例2: _compiler_dispatch
# 需要導入模塊: from sqlalchemy.sql import visitors [as 別名]
# 或者: from sqlalchemy.sql.visitors import Visitable [as 別名]
def _compiler_dispatch(cls, _visitor: Visitable, **_kw: Any) -> str:
return "TINYINT"