MCPcopy Index your code
hub / github.com/dbcli/pgcli / _has_limit

Method _has_limit

pgcli/main.py:1116–1119  ·  view source on GitHub ↗
(self, sql)

Source from the content-addressed store, hash-verified

1114 return not self._has_limit(sql) and self.row_limit != 0 and cur and cur.rowcount > self.row_limit
1115
1116 def _has_limit(self, sql):
1117 if not sql:
1118 return False
1119 return any(token.match(sqlparse_tokens.Keyword, "LIMIT") for statement in sqlparse.parse(sql) for token in statement.flatten())
1120
1121 def _limit_output(self, cur):
1122 limit = min(self.row_limit, cur.rowcount)

Callers 1

_should_limit_outputMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected