mtxr / SublimeText-SQLTools

SQLTools for Sublime Text 3
https://code.mteixeira.dev/SublimeText-SQLTools/
GNU General Public License v3.0
177 stars 40 forks source link

SnowSQL support #224

Open intheravine opened 4 years ago

intheravine commented 4 years ago

Issue Type

Question |

Description

I can connect to Snowflake and execute commands from ST using SQLTools - however after the query executes the snowsql session ends (Goodbye!). When running snowsql in terminal it does not close after each query. Is it supposed to behave that way in SQLTools? I use SQLTools to connect to other databases and the connections stay open between queries. If there's a way to keep the connection open so I don't have to reauthenticate between each query I'd would love to know how to do that. Thanks.

Version

Sample output from a query:

Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
* SnowSQL * v1.1.86
Type SQL statements or !help
+----------------------------------+
| status                           |
|----------------------------------|
| Statement executed successfully. |
+----------------------------------+
1 Row(s) produced. Time Elapsed: 0.241s
+---+
| X |
|---|
| 1 |
+---+
1 Row(s) produced. Time Elapsed: 0.212s
Goodbye!
tkopets commented 4 years ago

Hi!

Currently, each time you execute SQL a new process with CLI interface is invoked behind the scenes. After successful execution, error or timeout this process is closed. Usually, this means that each "execution" creates a new connection.

It would be nice to have the option of having a persistent connection in SQLTools someday. A PR is always welcome :).

You can try to find in docs if there are ways that would make authentication in Snowflake / SnowSQL easier for you. Maybe Kyle (@kforeman) can help you with this one, as he was kind enough to contribute the support for SnowSQL in SQLTools. Thanks, Kyle!