comparison sqlpyPlus.py @ 57:4931f32c8ff5

fixed bug in load
author catherine@cordelia
date Wed, 02 Apr 2008 20:55:23 -0400
parents ce2b64554091
children de6278a3bf53
comparison
equal deleted inserted replaced
56:dd1ab6a6d1dc 57:4931f32c8ff5
503 if override_terminator: 503 if override_terminator:
504 terminator = override_terminator 504 terminator = override_terminator
505 rowlimit = int(rowlimit or 0) 505 rowlimit = int(rowlimit or 0)
506 try: 506 try:
507 self.varsUsed = findBinds(self.query, self.binds, bindVarsIn) 507 self.varsUsed = findBinds(self.query, self.binds, bindVarsIn)
508 #import pdb; pdb.set_trace()
509 self.curs.execute(self.query, self.varsUsed) 508 self.curs.execute(self.query, self.varsUsed)
510 self.rows = self.curs.fetchmany(min(self.maxfetch, (rowlimit or self.maxfetch))) 509 self.rows = self.curs.fetchmany(min(self.maxfetch, (rowlimit or self.maxfetch)))
511 self.desc = self.curs.description 510 self.desc = self.curs.description
512 self.rc = self.curs.rowcount 511 self.rc = self.curs.rowcount
513 if self.rc > 0: 512 if self.rc > 0:
669 numCommandsLoaded = self.load(fname) 668 numCommandsLoaded = self.load(fname)
670 if numCommandsLoaded: 669 if numCommandsLoaded:
671 self.do_list('%d -' % (len(self.history) - numCommandsLoaded)) 670 self.do_list('%d -' % (len(self.history) - numCommandsLoaded))
672 def do_getrun(self, fname): 671 def do_getrun(self, fname):
673 'Brings SQL commands from a file to the in-memory SQL buffer, and executes them.' 672 'Brings SQL commands from a file to the in-memory SQL buffer, and executes them.'
674 numCommandsLoaded = self.load(fname) * -1 673 numCommandsLoaded = self.do_load(fname) * -1
675 if numCommandsLoaded: 674 if numCommandsLoaded:
676 for command in self.history[numCommandsLoaded:]: 675 for command in self.history[numCommandsLoaded:]:
677 self.onecmd_plus_hooks(command) 676 self.onecmd_plus_hooks(command)
678 def do_psql(self, arg): 677 def do_psql(self, arg):
679 '''Shortcut commands emulating psql's backslash commands. 678 '''Shortcut commands emulating psql's backslash commands.