def visit_join(self, join, asfrom=False, **kwargs):
join_type = " "
if join.global_:
join_type += "GLOBAL "
if join.any:
join_type += "ANY "
if join.all:
join_type += "ALL "
if join.isouter:
join_type += "LEFT OUTER JOIN "
else:
join_type += "INNER JOIN "
if not isinstance(join.onclause, elements.Tuple):
raise exc.CompileError(
"Only tuple elements are supported. "
"Got: %s" % type(join.onclause)
)
return (
join.left._compiler_dispatch(self, asfrom=True, **kwargs) +
join_type +
join.right._compiler_dispatch(self, asfrom=True, **kwargs) +
" USING " + join.onclause._compiler_dispatch(self, **kwargs)
)
评论列表
文章目录