MCPcopy
hub / github.com/dbcli/pgcli / _limit_output

Method _limit_output

pgcli/main.py:1121–1127  ·  view source on GitHub ↗
(self, cur)

Source from the content-addressed store, hash-verified

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)
1123 new_cur = itertools.islice(cur, limit)
1124 new_status = "SELECT " + str(limit)
1125 click.secho("The result was limited to %s rows" % limit, fg="red")
1126
1127 return new_cur, new_status
1128
1129 def _evaluate_command(self, text):
1130 """Used to run a command entered by the user during CLI operation

Callers 1

_evaluate_commandMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected