cweijan / vscode-database-client

Database Client For Visual Studio Code
https://database-client.com
MIT License
2.39k stars 264 forks source link

Executing multiple statements #1148

Closed alancnet closed 1 month ago

alancnet commented 1 month ago

Was there a recent change that would affect the behavior when executing multiple statements? For example, if I select all of:


-- Small table, executes in 5ms:
alter table user add column foo int;

-- Small table, executes in 5ms:
alter table profile add column bar int;

-- Large table, executes in 15 minutes:
alter table session add column baz int;

and press Ctrl-Enter, it opens two Result windows for the first two statements, but doesn't open a third window for the third statement.

Since the third statement takes a long time to run, I might not expect a result right away, but I would expect a way to cancel the long running statement. I recall being able to do that, but I can't do that now.

From what I recall, the results of all the statements would appear in the same tab, or at least the result from the last statement.

cweijan commented 1 month ago

Thanks feedback, I've released version 7.3.9 with the fix.

alancnet commented 1 month ago

@cweijan I just updated to 7.4.2 and it is opening multiple Result tabs when executing multiple statements.

cweijan commented 1 month ago

Hi, after version 7.4.2, result pages will only be created when data exists, such as executing a select query. This is to prevent a large number of result pages from appearing when batch insert is executed.

For DML, the execution status is displayed on the right side of the SQL.

image

For your feedback, I plan to display multiple execution statuses on the same result page in the next version.

alancnet commented 3 weeks ago

@cweijan v7.4.3, still opening a result tab per statement. In my case, I'm executing on PostgreSQL:

set role some_role;

alter table some_table
  drop column some_column,
  add column other_column int8 not null;

I then Ctrl+A then Ctrl+Enter to execute

cweijan commented 3 weeks ago

Thanks feedback, I will fix it in the next version.