Repository navigation
Handle big plans, clean cancel, 2 GB results, open transactions and lost tunnels on every engine - #311
Merged
Conversation
A console transaction starts with a plain BEGIN, so sqlx does not know the connection is in one. The idle sweep and a failed COMMIT dropped the session, sqlx handed the connection back to the pool still inside the transaction, and the next grid edit or console run joined it: writes never committed, locks held. A live test reproduces it. - Every session ends through release(): ROLLBACK, or close the socket if that fails. - The idle sweep runs on a one-minute timer, not only on begin and status. - Sessions carry the connection epoch. Switching, parking or closing the connection rolls them back, so a tab's statements can't run on a database the window has left. - Postgres sessions set idle_in_transaction_session_timeout as a server backstop. - The badge shows how long the transaction has been held and how many sessions wait on its locks (pg_blocking_pids, performance_schema). - Quit and window close ask before rolling back open transactions, and the quit path stops its 6 second fallback while a question is on screen.
… boot SSH tunnels - A supervisor rebuilds a lost tunnel on the same local port, with backoff, and tells the window (down, retrying, back, closed). - ssh's own error is reported (rejected key, changed host key) and BatchMode is on. The keepalive set in the form now reaches ssh. - A failed query says whether it reached the server; a write cut off by a lost tunnel reports "Result unknown". - SSH for SQL Server, Oracle, ClickHouse and Redis. TLS through a tunnel verifies the server's real name: Postgres and MySQL get libpq's hostaddr in the vendored drivers, the others dial the tunnel and keep the name. Parked Labs connections keep their tunnels. Backups, Data Diff and schema compare go through the tunnel. Stop - Real cancel for SQLite (sqlite3_interrupt), DuckDB (InterruptHandle), ClickHouse (KILL QUERY by query_id), SQL Server (KILL, then a fresh client) and MySQL scripts. Engines with no cancel say the server may still finish. EXPLAIN ANALYZE is stoppable and has a statement timeout. Big results - MySQL, SQLite, DuckDB and SQL Server stream into the result store like Postgres. Results held in memory stop at 512 MB with a clear message. The store checks free space and names a full disk. Plans - Parallel nodes are no longer counted once per worker, CTEs once only. Steps with more than 12 children fold to the ones that ran. Transactions - The badge counts the whole chain of sessions waiting on the transaction. Also - ScyllaDB has its own picker entry, mark and scylla:// URLs. - The connection dialog hands over before closing, so its panel never fades out over the form, and the launch overlay holds until the studio has painted. The connecting line animates transform. - Chrome (title bar, menus, tabs, toolbars, status bar) uses a sans face even with the Mono font. One outlined search box style. In-page shadows are 1px outlines. A zoom indicator. Custom and Imported themes are grouped by their real mode, and Imported is listed only when one exists. - Boot: stroke:// registration runs off the main thread (450ms on Linux desktops), the keychain read no longer blocks mounting, eight dialogs load on first open, and the last boot's timings are kept in stroke:last-boot.
…a and ScyllaDB - CouchDB, Elasticsearch and OpenSearch keep the server's name in the URL (TLS checks it) and resolve it to the tunnel. - Cassandra and ScyllaDB use the first contact point through the tunnel; the driver already reaches every node through one endpoint. - MongoDB points its mongodb:// host at the tunnel with directConnection=true. mongodb+srv:// and TLS are refused with a clear message: the driver can't dial one address while checking another name. - Test, connect, Data Diff and backups all go through the tunnel, and the form offers SSH for these engines.
Each runs on a connection of its own beside the shared one, so the grid and sidebar never read uncommitted rows. Closing the connection rolls back.
Reads use JSONCompactEachRowWithNamesAndTypes and feed the grid or result store as lines arrive, instead of parsing one JSONCompact document after the whole body landed. Stop kills the query by id; an error the server writes after the first rows is reported.
Page, panel and toolbar searches that were hand-styled (filled pills, field frames, rounded-full) now use search-box on the input or the new search-shell on a wrapper row, the same 1px outline as SearchField. Menu filter rows stay frameless.
The row inspector, query log, database name dialog, find and replace, extensions panel, dashboard window and trial screen were in the startup chunk though none shows at launch. The chunk drops from 778 KB to 698 KB.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The five cases that sink a database client, across every engine Stroke supports, plus the polish pass.
Big execution plans: the plan view handles plans with thousands of nodes (collapsed subtrees, hot-path highlight, search) for every engine with EXPLAIN.
Clean cancel: one Stop for every engine. Postgres and MySQL cancel on the server, SQL Server sends an attention, DuckDB interrupts, Oracle breaks the call, ClickHouse kills by query id, and the HTTP and document engines drop the request. A cancelled run never leaves a half-open connection in the pool.
2 GB results: Postgres, MySQL, SQLite, DuckDB, SQL Server and now ClickHouse stream rows into the result store with flat memory (2M-row tests hold growth under 120 MB). Engines that answer in one reply stop at a 512 MB budget with a clear message instead of running out of memory.
Long-open transactions: explicit transactions on Postgres, MySQL, SQLite, DuckDB, SQL Server and Oracle. Abandoned ones roll back instead of leaking into the pool, idle ones are swept, the console shows how long locks have been held and who is blocked behind them, and quitting with one open asks first.
Lost SSH tunnels: a supervisor reconnects tunnels, the status bar says when one is down, TLS keeps the real hostname through the tunnel, tunnels park on disconnect, and backups go through SSH. Tunnels now cover MongoDB, CouchDB, Elasticsearch, OpenSearch, Cassandra and ScyllaDB as well.
Also in here:
Checks: 421 Rust tests, 1838 vitest, svelte-check 0 errors, design lint clean. I verified the table toolbar, sidebar and row inspector in the real app on Linux.
Known limits: MongoDB TLS and
mongodb+srvthrough SSH are refused (driver limitation), DuckDB still materializes its result natively, and I could not test Windows.