The object command palette derives its database list from the saved connection parameter, while every other consumer uses the list the provider actually resolved. The two drift apart.
src/hooks/useCommandPaletteObjectItems.ts:66-69:
const configuredDatabases = useMemo(
() => getDatabaseList(connection?.params.database ?? ""),
[connection?.params.database],
);
The sidebar instead reads connectionData.selectedDatabases (src/components/layout/ExplorerSidebar.tsx:140), which the provider keeps current. Neither setSelectedDatabases (src/contexts/DatabaseProvider.tsx:566) nor refreshDatabaseSelection (src/contexts/DatabaseProvider.tsx:149) writes back to params.database.
Consequences
1. All-databases mode (#572): the object palette is empty.
In that mode params.database is empty by design — the real list comes from get_available_databases at connect time (src/contexts/DatabaseProvider.tsx:676-687). So configuredDatabases resolves to [], and getNavigatorItems builds its groups exclusively from that array:
// src/utils/quickNavigator.ts:125-129
} else if (isMultiDb) {
groups = configuredDatabases.flatMap((group) => {
const data = databaseDataMap[group];
return data ? [{ group, data }] : [];
});
An empty array yields no groups and therefore no items. The eager-load effect (src/hooks/useCommandPaletteObjectItems.ts:85-89) iterates the same empty array, so nothing recovers it.
2. Stale list after a selection change.
Changing the database selection in the sidebar, the manual refresh added in #530, or the pruning of dropped databases added in #524 all update selectedDatabases only — the palette keeps offering the old set.
3. Divergent branch condition.
The palette uses isMultiDatabaseCapable(capabilities) (capability only), while the sidebar uses usesMultiDatabaseLayout(capabilities, selectedDatabases) — capability and a non-empty selection (src/utils/database.ts:50-55). The two can take different layout branches for the same connection.
Suggested fix
Read connectionData.selectedDatabases instead of getDatabaseList(connection.params.database), and align the multi-database check with usesMultiDatabaseLayout.
Notes
Pre-existing, not introduced by #545 — filed separately as agreed in that PR's review rather than growing its diff.
Found by reading the code; reproducing it needs a MySQL/MariaDB connection with an empty database field, since schema-based drivers take a different branch.
The object command palette derives its database list from the saved connection parameter, while every other consumer uses the list the provider actually resolved. The two drift apart.
src/hooks/useCommandPaletteObjectItems.ts:66-69:The sidebar instead reads
connectionData.selectedDatabases(src/components/layout/ExplorerSidebar.tsx:140), which the provider keeps current. NeithersetSelectedDatabases(src/contexts/DatabaseProvider.tsx:566) norrefreshDatabaseSelection(src/contexts/DatabaseProvider.tsx:149) writes back toparams.database.Consequences
1. All-databases mode (#572): the object palette is empty.
In that mode
params.databaseis empty by design — the real list comes fromget_available_databasesat connect time (src/contexts/DatabaseProvider.tsx:676-687). SoconfiguredDatabasesresolves to[], andgetNavigatorItemsbuilds its groups exclusively from that array:An empty array yields no groups and therefore no items. The eager-load effect (
src/hooks/useCommandPaletteObjectItems.ts:85-89) iterates the same empty array, so nothing recovers it.2. Stale list after a selection change.
Changing the database selection in the sidebar, the manual refresh added in #530, or the pruning of dropped databases added in #524 all update
selectedDatabasesonly — the palette keeps offering the old set.3. Divergent branch condition.
The palette uses
isMultiDatabaseCapable(capabilities)(capability only), while the sidebar usesusesMultiDatabaseLayout(capabilities, selectedDatabases)— capability and a non-empty selection (src/utils/database.ts:50-55). The two can take different layout branches for the same connection.Suggested fix
Read
connectionData.selectedDatabasesinstead ofgetDatabaseList(connection.params.database), and align the multi-database check withusesMultiDatabaseLayout.Notes
Pre-existing, not introduced by #545 — filed separately as agreed in that PR's review rather than growing its diff.
Found by reading the code; reproducing it needs a MySQL/MariaDB connection with an empty database field, since schema-based drivers take a different branch.