Conversation
- Add ExportDialog with table selection tree and format options - Support CSV export with configurable delimiter, quoting, line breaks - Support JSON export with pretty print and null value options - Support SQL export with structure, data, drop statements, and gzip compression - Add real-time progress dialog with row count and cancellation support - Add success dialog with "Open containing folder" and "Don't show this again" options - Add Export option to sidebar context menu and Database menu (⌘⇧E) - Optimize export for large tables with throttled progress updates - Run compression and file writes on background threads
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive table export functionality to TablePro, enabling users to export database tables to CSV, JSON, and SQL formats. The feature includes a sophisticated UI with table selection trees, format-specific options, real-time progress tracking, and keyboard shortcuts for improved workflow efficiency.
Key changes:
- Export service layer with format-specific logic for CSV, JSON, and SQL exports
- Dialog-based UI with table selection tree supporting multi-database/schema selection
- Progress tracking with throttled updates and cancellation support
- Success dialog with "Don't show again" preference and quick folder access
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| TablePro/Views/Sidebar/SidebarView.swift | Adds "Export..." context menu options and ⌘⇧E keyboard shortcuts |
| TablePro/Views/MainContentView.swift | Passes table data to alert handler for export dialog |
| TablePro/Views/Main/MainContentNotificationHandler.swift | Handles exportTables notification to trigger dialog |
| TablePro/Views/Main/MainContentCoordinator.swift | Adds showExportDialog published state |
| TablePro/Views/Main/Child/MainContentAlerts.swift | Presents export dialog sheet with preselected tables |
| TablePro/Views/Main/Child/QueryTabContentView.swift | Adds onDismissError callback parameter |
| TablePro/Views/Export/ExportDialog.swift | Main export dialog with format selection, options, and save logic |
| TablePro/Views/Export/ExportTableTreeView.swift | Tree view for selecting tables with SQL-specific checkboxes |
| TablePro/Views/Export/ExportProgressView.swift | Progress dialog showing current table and row counts |
| TablePro/Views/Export/ExportSuccessView.swift | Success dialog with folder access and preference toggle |
| TablePro/Views/Export/ExportCSVOptionsView.swift | CSV format options (delimiter, quoting, line breaks, etc.) |
| TablePro/Views/Export/ExportJSONOptionsView.swift | JSON format options (pretty print, null handling) |
| TablePro/Views/Export/ExportSQLOptionsView.swift | SQL format options (gzip compression) |
| TablePro/Models/ExportModels.swift | Data models for export configuration and options |
| TablePro/Core/Services/ExportService.swift | Core export logic with progress tracking and format handlers |
| TablePro/TableProApp.swift | Adds "Export..." menu item with keyboard shortcut |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Remove duplicate keyboard shortcuts from context menus (keep only in main menu) - Fix SQL injection in schema/database queries by escaping single quotes - Optimize memory usage: stream CSV/SQL exports directly to file instead of building in memory - Use file-to-file gzip compression for better performance
- Combine tableContextMenu(for:) and sidebarContextMenu() into tableContextMenu(clickedTable:) - All menu items always visible with disabled state when no selection - Smart behavior: clicking table row without selection uses that table - Cleaner, more maintainable single source of truth
- Remove unused Compression import - Replace force unwraps with safe toUTF8Data() helper that throws on failure - Add proper error handling for file creation with guard statements - Stream JSON export directly to file instead of building in memory - Add escapeJSONString() and formatJSONValue() helpers for proper JSON formatting
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 16 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 14 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 13 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Features
Performance
Test plan