Repository navigation
Sidebar: context menus for connections, schemas and objects - #9
Merged
Merged
Conversation
…s per engine object_ddl scripts tables, views, routines, sequences and other objects from each database's catalog; columns report their default. ddl.ts writes the CREATE/ALTER/RENAME/DROP/TRUNCATE statements the sidebar will use, and the fixtures run them, with a DDL round trip, against every database.
Right-click, the context-menu key or the row's ⋯ button opens a menu for the node: connect, refresh, create schemas and databases, server sessions and the profile actions on connections; new query, create table, object templates, rename and drop on schemas; select, count, DDL, generated SQL, edit, rename, duplicate, empty and drop on tables, with Redis key actions. Changes show their SQL first and can open in the editor instead. A table designer creates tables and writes ALTER TABLE for each engine.
FabioHAraujo
marked this pull request as ready for review
October 22, 2026 20:26
DBMS_METADATA fails to fetch functions on Oracle 23ai with ORA-01002.
Running a cached DBMS_METADATA query a third time in a session fails with ORA-01002 on Oracle 23ai; each Show DDL query now opens its own cursor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8
Problem and resulting behavior
The sidebar only had a small ⋯ menu on connections. Schemas, databases and objects had no actions, so dropping a table, reading its DDL, renaming it or creating a new one meant writing the SQL by hand.
Now a right-click (or the context-menu key, or the ⋯ button shown on hover) opens a menu for every node of the tree, with what makes sense for that node and engine:
ALTER TABLE), rename, duplicate with or without rows, empty, refresh materialized views, copy names and column lists, drop any kind of object. Redis keys: show, TTL, rename, expire, persist, delete.Every change shows its SQL before running (on the tree's own session, never a tab's) and can open in the editor instead.
Backend: a new
object_ddlcommand reads DDL from each database's catalog (pg_get_*def+ catalog,DBMS_METADATA,SHOW CREATE,OBJECT_DEFINITION+sys.*,sqlite_schema), andlist_columnsnow reports column defaults.Validation
src/lib/sql/ddl.fixtures.jsonholds the statementsddl.tswrites for a full scenario per dialect (create, index, foreign key, designer ALTERs, rename, duplicate, truncate, drop, schemas, primary key added later).drivers/ddl_fixtures.rsruns it on PostgreSQL 13 and 17, Oracle 23ai and XE 21c, MySQL 8.4, MariaDB 11.4, SQL Server 2022 and SQLite in CI, plus a DDL round trip for tables, views and sequences (read the DDL, drop the object, run the DDL, compare the columns) and a DDL check for functions.bun test(unit tests forddl.ts, including that the editor's script splitter keeps PL/SQL and T-SQL blocks whole),svelte-check,cargo clippy -D warnings,cargo fmt.Additional context