MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / visit_frame_clause

Method visit_frame_clause

lib/sqlalchemy/sql/compiler.py:2970–2994  ·  view source on GitHub ↗
(self, frameclause, **kw)

Source from the content-addressed store, hash-verified

2968 )
2969
2970 def visit_frame_clause(self, frameclause, **kw):
2971
2972 if frameclause.lower_type is elements.FrameClauseType.UNBOUNDED:
2973 left = "UNBOUNDED PRECEDING"
2974 elif frameclause.lower_type is elements.FrameClauseType.CURRENT:
2975 left = "CURRENT ROW"
2976 else:
2977 val = self.process(frameclause.lower_bind, **kw)
2978 if frameclause.lower_type is elements.FrameClauseType.PRECEDING:
2979 left = f"{val} PRECEDING"
2980 else:
2981 left = f"{val} FOLLOWING"
2982
2983 if frameclause.upper_type is elements.FrameClauseType.UNBOUNDED:
2984 right = "UNBOUNDED FOLLOWING"
2985 elif frameclause.upper_type is elements.FrameClauseType.CURRENT:
2986 right = "CURRENT ROW"
2987 else:
2988 val = self.process(frameclause.upper_bind, **kw)
2989 if frameclause.upper_type is elements.FrameClauseType.PRECEDING:
2990 right = f"{val} PRECEDING"
2991 else:
2992 right = f"{val} FOLLOWING"
2993
2994 return f"{left} AND {right}"
2995
2996 def visit_over(self, over, **kwargs):
2997 text = over.element._compiler_dispatch(self, **kwargs)

Callers

nothing calls this directly

Calls 1

processMethod · 0.45

Tested by

no test coverage detected