How stokay/mysqlclient works
MySQL Client is a native macOS database-management app. The main workflow is to save/select a connection, connect to MySQL, browse schema or run SQL, then inspect or modify data; import, export, and backup are separate task branches. The graph follows the documented MVVM structure and sampled call/reference evidence. Several view models and feature implementations are unsampled, so their internal calls are not expanded beyond documented relationships.
Main entry points: MainWindowView.swift Main window · MySQLService.swift MySQL service · MySQLMacClientApp.swift App lifecycle · QueryPanelView.swift SQL panel
Components 26
App and UI
- App lifecycle
Sources/MySQLMacClient/App/MySQLMacClientApp.swift - Main window
Sources/MySQLMacClient/Views/MainWindowView.swift - Connection form
Sources/MySQLMacClient/Views/ConnectionFormView.swift
Connections and schema
- Connection profiles
Sources/MySQLMacClient/ViewModels/ConnectionFormViewModel.swift - Session state
Sources/MySQLMacClient/App/AppState.swift - Credential vault
Sources/MySQLMacClient/Services/KeychainService.swift - MySQL service
Sources/MySQLMacClient/Services/MySQLService.swift - Schema browser
Sources/MySQLMacClient/ViewModels/SchemaTreeViewModel.swift - Schema introspection
Sources/MySQLMacClient/Services/SchemaIntrospectionService.swift
Queries and data
- SQL panel
Sources/MySQLMacClient/Views/QueryPanelView.swift - SQL editor
Sources/MySQLMacClient/Views/SQLTextView.swift - SQL console
Sources/MySQLMacClient/ViewModels/SQLConsoleViewModel.swift - Query results
Sources/MySQLMacClient/Views/QueryResultGridView.swift - Query history
Sources/MySQLMacClient/Persistence/QueryHistoryRecorder.swift - Table data grid
Sources/MySQLMacClient/ViewModels/TableDataViewModel.swift
Import and export
- Table import
Sources/MySQLMacClient/ViewModels/TableImportViewModel.swift - CSV and XLSX readers
Sources/MySQLMacClient/Import - Table export
Sources/MySQLMacClient/ViewModels/TableExportViewModel.swift - Export formats
Sources/MySQLMacClient/Export - Database backup
Sources/MySQLMacClient/ViewModels/DatabaseBackupViewModel.swift - Atomic file writer
Sources/MySQLMacClient/Export/AtomicFileWriter.swift
Local state
- Profile storage
Sources/MySQLMacClient/Persistence/ConnectionStore.swift - Settings storage
Sources/MySQLMacClient/Persistence/SettingsStore.swift - History storage
Sources/MySQLMacClient/Persistence/QueryHistoryStore.swift
Other components
- Database user
- MySQL server
Connections 35
- Database user → App lifecycle: launches
README.md - App lifecycle → Connection form: presents
Sources/MySQLMacClient/App/MySQLMacClientApp.swift - App lifecycle → Main window: presents
Sources/MySQLMacClient/App/MySQLMacClientApp.swift - Connection form → Connection profiles: uses
- Connection profiles → Profile storage: persists profiles
- Connection profiles → Credential vault: stores passwords
- Connection form → Session state: initiates session
- Session state → MySQL service: manages connection
Sources/MySQLMacClient/App/AppState.swift - Session state → Schema introspection: creates
Sources/MySQLMacClient/App/AppState.swift - MySQL service → MySQL server: queries
README.md - Main window → Schema browser: presents browser
- Schema browser → Schema introspection: loads schema
- Schema introspection → MySQL service: runs metadata queries
Sources/MySQLMacClient/Services/SchemaIntrospectionService.swift - Main window → SQL panel: presents
- SQL panel → SQL editor: embeds editor
Sources/MySQLMacClient/Views/QueryPanelView.swift - SQL panel → SQL console: uses
Sources/MySQLMacClient/Views/QueryPanelView.swift - SQL console → MySQL service: runs SQL
Sources/MySQLMacClient/ViewModels/SQLConsoleViewModel.swift - SQL console → Query history: records queries
Sources/MySQLMacClient/ViewModels/SQLConsoleViewModel.swift - Query history → History storage: persists entries
Sources/MySQLMacClient/Persistence/QueryHistoryRecorder.swift - SQL panel → Query results: displays results
Sources/MySQLMacClient/Views/QueryPanelView.swift - Main window → Table data grid: presents table data
- Table data grid → MySQL service: reads and edits rows
- Main window → Table import: offers import
- Table import → CSV and XLSX readers: parses files
- Table import → MySQL service: imports rows
- Main window → Table export: offers export
- Table export → MySQL service: reads table pages
- Table export → Export formats: formats output
- Table export → Atomic file writer: writes file
- Main window → Database backup: offers backup
- Database backup → MySQL service: reads database objects
Sources/MySQLMacClient/ViewModels/DatabaseBackupViewModel.swift - Database backup → Schema introspection: loads metadata
Sources/MySQLMacClient/ViewModels/DatabaseBackupViewModel.swift - Database backup → Atomic file writer: writes dump
Sources/MySQLMacClient/ViewModels/DatabaseBackupViewModel.swift - App lifecycle → Profile storage: owns profiles
Sources/MySQLMacClient/App/MySQLMacClientApp.swift - App lifecycle → Settings storage: owns settings
Sources/MySQLMacClient/App/MySQLMacClientApp.swift