MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _use_top

Method _use_top

lib/sqlalchemy/dialects/mssql/base.py:2146–2159  ·  view source on GitHub ↗
(self, select)

Source from the content-addressed store, hash-verified

2144 return select._fetch_clause
2145
2146 def _use_top(self, select):
2147 return (select._offset_clause is None) and (
2148 select._simple_int_clause(select._limit_clause)
2149 or (
2150 # limit can use TOP with is by itself. fetch only uses TOP
2151 # when it needs to because of PERCENT and/or WITH TIES
2152 # TODO: Why? shouldn't we use TOP always ?
2153 select._simple_int_clause(select._fetch_clause)
2154 and (
2155 select._fetch_clause_options["percent"]
2156 or select._fetch_clause_options["with_ties"]
2157 )
2158 )
2159 )
2160
2161 def limit_clause(self, cs, **kwargs):
2162 return ""

Callers 4

get_select_precolumnsMethod · 0.95
_row_limit_clauseMethod · 0.95
order_by_clauseMethod · 0.95

Calls 1

_simple_int_clauseMethod · 0.80

Tested by

no test coverage detected