-
-
Notifications
You must be signed in to change notification settings - Fork 278
fix(perf): open tables without waiting behind background schema introspection #1483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
04b5f3e
feat(sidebar): show all databases on the server as a tree (#139)
datlechin cb0c442
fix(sidebar): metadata pool lifecycle, reconnect teardown, and observ…
datlechin e7f293c
feat(sidebar): tree/flat layout option with native styling and large-…
datlechin c88cff5
fix(sidebar): tree context-menu targets the clicked database and pool…
datlechin 50e90a8
Merge branch 'main' into feat/139-sidebar-database-tree
datlechin 25cee6a
refactor(sidebar): database-qualified tree row identity and serialize…
datlechin 82323b7
fix(sidebar): reload stranded tree rows after switching active databa…
datlechin 635b620
fix(sidebar): keep tree schema list stable when switching the active …
datlechin 397f380
fix(sidebar): load tree routines per schema and skip loads while reco…
datlechin 186f2cc
fix(sidebar): retry failed tree loads after reconnect instead of bloc…
datlechin 3056d9c
fix(perf): open tables without waiting behind background schema intro…
datlechin 0ef4d41
Merge branch 'main' into fix/metadata-connection-contention
datlechin c037a0c
perf(datagrid): run exact and filtered row counts on the bulk metadat…
datlechin 46726a6
refactor(query): extract duplicated table-schema sidecar fetch into o…
datlechin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // | ||
| // DatabaseManager+Metadata.swift | ||
| // TablePro | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| extension DatabaseManager { | ||
| func withMetadataDriver<T: Sendable>( | ||
| connectionId: UUID, | ||
| workload: MetadataConnectionPool.Workload = .interactive, | ||
| _ body: @Sendable @escaping (DatabaseDriver) async throws -> T | ||
| ) async throws -> T { | ||
| guard let session = session(for: connectionId) else { | ||
| throw DatabaseError.notConnected | ||
| } | ||
| return try await MetadataConnectionPool.shared.withDriver( | ||
| connectionId: connectionId, | ||
| database: session.activeDatabase, | ||
|
datlechin marked this conversation as resolved.
|
||
| schema: session.currentSchema, | ||
| workload: workload, | ||
| body | ||
| ) | ||
| } | ||
| } | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an editable table is connection-local (for example a PostgreSQL/MySQL temporary table, or a temp table shadowing a permanent table), this new count path runs
SELECT COUNT(*)on a pooled metadata connection instead of the session connection that loaded the grid. That separate connection cannot see the same temp objects/session state, so the row-count refresh can fail or report a different table’s count even though the data grid query itself succeeded; the prior implementation executed this count on the active driver.Useful? React with 👍 / 👎.