Problem Description
Currently, Querya Desktop does not declare file associations or accept command line file arguments. When a user right-clicks a .sql script or a SQLite database (.db, .sqlite, .sqlite3) in their desktop file manager (GNOME Files/Nautilus, Dolphin, Windows Explorer, macOS Finder) and selects 'Open with...', Querya is not listed as an associated application. Furthermore, launching the application with a file argument (querya_desktop /path/to/file) does not open the file in the workspace.
Proposed Changes
-
Desktop Entry & OS Packaging Associations:
- Linux: Update querya_desktop.desktop (standard, flatpak, aur) to include Exec=querya_desktop %F and MimeType=application/sql;text/x-sql;application/x-sqlite3;application/vnd.sqlite3;application/x-sqlite;.
- Windows: Add [Registry] entries for .sql and .sqlite/.sqlite3/.db file associations in packaging/windows/querya.iss.
- macOS: Add CFBundleDocumentTypes for SQL and SQLite files in macos/Runner/Info.plist.
-
File Launch Service & Argument Processing:
- Update void main(List<String> args) in lib/main.dart to capture launch arguments.
- Create FileLaunchService to resolve and parse passed file paths, extract file extension, and handle file opening on startup.
-
Workspace Direct Open Flow:
- SQLite databases (.db, .sqlite, .sqlite3, .db3): If a connection row with matching path already exists, select and open it. If not, auto-create a local SQLite connection and open its workspace directly.
- SQL scripts (.sql): Read script content and open a query tab loaded with the file's content and track its file path.
-
Testing:
- Unit and integration tests for FileLaunchService covering path resolution, MIME/extension detection, SQLite connection creation, and SQL content loading.
Reactions are currently unavailable
Problem Description
Currently, Querya Desktop does not declare file associations or accept command line file arguments. When a user right-clicks a .sql script or a SQLite database (.db, .sqlite, .sqlite3) in their desktop file manager (GNOME Files/Nautilus, Dolphin, Windows Explorer, macOS Finder) and selects 'Open with...', Querya is not listed as an associated application. Furthermore, launching the application with a file argument (querya_desktop /path/to/file) does not open the file in the workspace.
Proposed Changes
Desktop Entry & OS Packaging Associations:
File Launch Service & Argument Processing:
Workspace Direct Open Flow:
Testing: