mirror of
https://github.com/dbcli/pgcli.git
synced 2024-10-06 10:17:15 +03:00
Merge pull request #449 from davidszotten/fix_execute_from_file
fix execute_from_file after #395
This commit is contained in:
commit
f8ba5c6f54
@ -157,7 +157,10 @@ class PGCli(object):
|
||||
except IOError as e:
|
||||
return [(None, None, None, str(e))]
|
||||
|
||||
return self.pgexecute.run(query, self.pgspecial, on_error=self.on_error)
|
||||
on_error_resume = (self.on_error == 'RESUME')
|
||||
return self.pgexecute.run(
|
||||
query, self.pgspecial, on_error_resume=on_error_resume
|
||||
)
|
||||
|
||||
def initialize_logging(self):
|
||||
|
||||
|
@ -260,7 +260,11 @@ class PGExecute(object):
|
||||
cur = self.conn.cursor()
|
||||
try:
|
||||
for result in pgspecial.execute(cur, sql):
|
||||
yield result + (sql, True)
|
||||
# e.g. execute_from_file already appends these
|
||||
if len(result) < 6:
|
||||
yield result + (sql, True)
|
||||
else:
|
||||
yield result
|
||||
continue
|
||||
except special.CommandNotFound:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user