Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit b012edb

Browse files
committed
Use stream output for saved queries and history
1 parent 6496dc8 commit b012edb

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

SQLTools.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ def run():
502502
def cb(index):
503503
if index < 0:
504504
return None
505-
return ST.conn.execute(history.get(index), createOutput())
505+
return ST.conn.execute(history.get(index), createOutput(),
506+
stream=settings.get('use_streams', False))
506507

507508
Window().show_quick_panel(history.all(), cb)
508509

@@ -538,9 +539,14 @@ def cb(index):
538539
if index < 0:
539540
return None
540541

541-
param2 = createOutput() if mode == "run" else options[index][0]
542-
func = ST.conn.execute if mode == "run" else toNewTab
543-
return func(options[index][1], param2)
542+
alias, query = options[index]
543+
if mode == "run":
544+
ST.conn.execute(query, createOutput(),
545+
stream=settings.get('use_streams', False))
546+
else:
547+
toNewTab(query, alias)
548+
549+
return
544550

545551
try:
546552
Window().show_quick_panel(options, cb)

SQLToolsAPI/Command.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def run(self):
6161

6262
queryTimerEnd = time.time()
6363
# we are done with the output, terminate the process
64-
self.process.terminate()
64+
if self.process:
65+
self.process.terminate()
6566

6667
if 'show_query' in self.options and self.options['show_query']:
6768
formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd)

0 commit comments

Comments
 (0)