Repository navigation
refactor(macos): move 35 stores onto one JSON store type and share one database list - #4303
Merged
Merged
Conversation
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.
Summary
DatabaseSwitcherList, hosted by the toolbar's database and schema switcher and by Restore Dump's database picker.DatabaseSwitcherSheetis deleted.Core/Storage/Preferences:JSONDefaultsKeywithKeyValueStore.read,writeandremoveValue, andJSONFileStorefor one JSON value per file. A read returnsStoreRead(missing, value, unreadable) and a write throws, so a store can tell damaged data from none. Failures are logged in one place, with a key or file name public only up to its connection id, so database, schema and table names stay private.CodableListPreferenceStore(linked folders, linked SQL folders),RowGenerationSettingsStore,ServerDashboardTileStorage,ImportColumnMappingStore,ValueDisplayFormatStorage,InspectorFieldHeightStore,WorkspaceRailOrderStore,RecentTablesStore,TableFolderStorage,RecentConnectionsStore,ERDiagramPositionStorage,HistoryPanelPreferencesStorage,QueryInsightsPreferencesStorage,ExternalConnectionTrustStore,MCPApprovalStore,LoadableExtensionApprovalStore,CustomSlashCommandStorage,FavoriteDatabasesStorage,DatabaseTreeFilterStorage,ConnectionApprovalStore,CompareSyncProfileStorage,MCPServerStore,FilterPresetStorage,FavoritesExpansionState.AgentSessionStore,LastOpenConnectionsStorage,ExportProfileStorage,RecentlyClosedTabStore,HighlightRuleStorage,TableHealthHistoryStorage,AIChatStorage,SandboxKeychainStore,TeamLibraryStateStore.GroupStorage,TagStorage,FavoriteTablesStorageand the favourites order (they move to the core's library in ADR 0010 slice 1b),SSHProfileStorage,CredentialProfileStorage,FilterSettingsStorage,ColumnLayoutPersister,TabDiskActor,AppSettingsStorage,MCPTokenStore,ExecutionAuditLog,WindowSidebarState, the Cloudflare, Cloud SQL and tunnel command managers,RemoteDatabaseFileStore,LegacyLicenseStore. Not JSON value stores: the SQLite stores,TableLoadHistoryStore(JSON lines),ForeignKeyLabelColumnStore(sentinel bytes), and the plist-valued expansion and option stores.ConnectionLibraryandtablepro_storage::cloudkitthe one model and mapper (slices 1b and 2), which needs the core library linked into both apps first.Test plan
JSONDefaultsKeyTests,JSONFileStoreTestsandStoreLogTests: missing, unreadable data left in place, round trip, the written bytes match the encoder each store used before, and the logged name stops at the connection id.DatabaseSwitcherFilterTestsandDatabaseSwitcherRefreshTestspass.Refs #4273