sqltabs icon indicating copy to clipboard operation
sqltabs copied to clipboard

For each query execution a new connection is opened

Open willyrgf opened this issue 5 years ago • 2 comments

I'm running the SQL Tabs v1.1.0, the last release to MacOSX Catalina (10.15.7) and for each query execution for both MySQL and PostgreSQL databases the SQL Tabs open a new connection, in some time I reach the limit of max_connection of the database and drop down all application using that database.

Anyone have same problem?

I like too much of this sql client, but I don't programming in JS to debug and fix that.

Thanks

willyrgf avatar Nov 21 '20 23:11 willyrgf

Hi, SQL Tabs opens a connection for each tab, plus it opens one more connection per unique connection string for fetching autocompletion metadata. I think it doesn't open connectoin for each query, it would be too much. Probbably the issue is it doesn't close a connection when a tab get closed. So when you open and close tabs pretty often you might run out of max_connections. That's true. I will take a look how to fix it, but for the moment I would suggest to reuse existing tabs rather than open and close new ones.

sasha-alias avatar Nov 23 '20 15:11 sasha-alias

Hi there, I made a lot of tests and in my test I could understand that:

  • Using a MySQL 5.6, if I use the password in the connection string (mysql://user:[email protected]), the SQL Tabs open a new connection for each query;
  • In the same envorinment if I don't put the password in the connection string (mysql://[email protected]), and type the password when asked, the SQL Tabs only open one connection per tab, like you say;

Maybe you can reproduce that.

willyrgf avatar Jan 25 '21 15:01 willyrgf