mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.43k stars 290 forks source link

Attempting to run individual statements or clicking 'đź”’ Active Connection' results in error messages despite existing connection. #1350

Open WachtMeizter opened 1 week ago

WachtMeizter commented 1 week ago

Describe the bug 'No active connection found' and 'You need to create the connection first!' messages for trying to run statements when active connection exists. Can use the command 'Run on active connection' for blocks but not Run on individual statements.

To Reproduce Steps to reproduce the behavior:

  1. Go to SQLTools>Connections>Add New Connection
  2. Set up connection to local database, using localhost, port 3306, database name 'user' password 'password' password mode save as plaintext.
  3. Test connection, confirm "successfully connected" message. Save connection.
  4. Press 'CONNECT NOW'.
  5. Write a simple statement like CREATE TABLE test(id INT PRIMARY KEY AUTO_INCREMENT);
  6. Click 'Run' above the statement.

Expected behavior The query triggers as expected, creating a new table called test with one empty column.

Screenshots Enter data: image

Test connection: image

Connection exists: image

'Connect now': image

Fault occurs: image

Possibly relevant warnings: image

Desktop (please complete the following information):

Additional context Was following a tutorial by Fireship to set up my database and got stuck on not being able to run code on blocks ( -- @block) and noticed it didn't work.