feat(database): create and drop databases and schemas from the tree (#4201)

The Database tree gets New > Database... and New > Schema..., and Drop... on database nodes (PostgreSQL, MySQL/MariaDB schemas, SQL Server), each with a preview of the statement it runs.

Creating closes the IDE's own connections to the database the server copies (the template on PostgreSQL, model on SQL Server), which both refuse to copy while it has sessions. Dropping closes the IDE's pools and sessions of that database first and runs DROP DATABASE on the data source's default database; "Close the sessions of other clients" adds WITH (FORCE) on PostgreSQL 13+ and single-user mode on SQL Server. Drop is refused for the data source's own database and read-only data sources. Both go through withConnection, so a password the data source does not save is asked for first.

Closes #3189

Co-authored-by: EjaYF <9842286+EjaYF@users.noreply.github.com>
This commit is contained in:
Ernstjan Freriks
2026-11-18 18:17:18 +08:00
committed by GitHub
co-authored by EjaYF
parent bb243909bf
commit e689c95e93
19 changed files with 581 additions and 10 deletions
@@ -370,6 +370,9 @@
font-size: var(--fs-small);
color: var(--fg-muted);
}
.formFull {
grid-column: 1 / -1;
}
.paramInput {
font-family: var(--openidea-editor-font, var(--font-mono));
font-weight: var(--fw-code);