diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1f253e7..5351b5a3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- TablePro no longer shows its icon for .sql, .sqlite, and .duckdb files in Finder when it is not the default app for those types. (#1594) - The JSON results view shows row data right away instead of staying blank until you switch between Tree and Text, and it updates when the row selection changes. A spinner shows while large results are being formatted. (#1576) - Double-clicking or pressing Enter on a JSON cell now edits its value inline, like other cells; on a blob cell it opens the hex editor. The chevron still opens the tree or hex editor. Neither cell responded to double-click before. (#1588) - Query results appear as soon as the database returns rows. Column defaults, foreign keys, and row counts now load in the background instead of holding up the grid, which removes a multi-second wait on remote databases whose system tables are slow to query. (#1574) diff --git a/TablePro/Info.plist b/TablePro/Info.plist index fe3c5d7ae..277bba8e2 100644 --- a/TablePro/Info.plist +++ b/TablePro/Info.plist @@ -15,18 +15,17 @@ sql - CFBundleTypeIconFile - SQLDocument + CFBundleTypeIconSystemGenerated + CFBundleTypeName SQL File CFBundleTypeRole Editor LSHandlerRank - Owner + Default LSItemContentTypes - com.tablepro.sql - public.sql + org.iso.sql @@ -58,6 +57,8 @@ sqlite3 sqlitedb + CFBundleTypeIconSystemGenerated + CFBundleTypeName SQLite Database CFBundleTypeRole @@ -66,8 +67,7 @@ Alternate LSItemContentTypes - com.apple.sqlite3 - com.tablepro.sqlite-db + org.sqlite.sqlite @@ -87,12 +87,14 @@ + CFBundleTypeIconSystemGenerated + CFBundleTypeName DuckDB Database CFBundleTypeRole Editor LSHandlerRank - Owner + Default CFBundleTypeExtensions duckdb @@ -100,7 +102,7 @@ LSItemContentTypes - com.tablepro.duckdb + org.duckdb.duckdb-database @@ -136,19 +138,16 @@ - UTExportedTypeDeclarations + UTImportedTypeDeclarations UTTypeIdentifier - com.tablepro.sql + org.iso.sql UTTypeDescription SQL File - UTTypeIconFile - SQLDocument UTTypeConformsTo - public.sql - public.plain-text + public.source-code UTTypeTagSpecification @@ -160,12 +159,11 @@ UTTypeIdentifier - com.tablepro.sqlite-db + org.sqlite.sqlite UTTypeDescription SQLite Database UTTypeConformsTo - com.apple.sqlite3 public.database public.data @@ -185,7 +183,7 @@ UTTypeIdentifier - com.tablepro.duckdb + org.duckdb.duckdb-database UTTypeDescription DuckDB Database UTTypeConformsTo @@ -202,6 +200,9 @@ + + UTExportedTypeDeclarations + UTTypeIdentifier com.tablepro.connection-share diff --git a/TablePro/Resources/SQLDocument.icns b/TablePro/Resources/SQLDocument.icns deleted file mode 100644 index df6fddace..000000000 Binary files a/TablePro/Resources/SQLDocument.icns and /dev/null differ diff --git a/TableProTests/Core/Services/Infrastructure/URLClassifierTests.swift b/TableProTests/Core/Services/Infrastructure/URLClassifierTests.swift index 24f0a0b18..c8a310caa 100644 --- a/TableProTests/Core/Services/Infrastructure/URLClassifierTests.swift +++ b/TableProTests/Core/Services/Infrastructure/URLClassifierTests.swift @@ -49,4 +49,33 @@ struct URLClassifierTests { } #expect(intent == nil) } + + @Test("SQL file routes to openSQLFile") + func routesSQLFile() { + let sqlURL = URL(fileURLWithPath: "/tmp/query.sql") + let intent = URLClassifier.classify(sqlURL) + guard case .some(.success(.openSQLFile(let routed))) = intent else { + Issue.record("Expected .openSQLFile, got \(String(describing: intent))") + return + } + #expect(routed == sqlURL) + } + + @Test("DuckDB file routes to openDatabaseFile with the DuckDB type", arguments: ["duckdb", "ddb"]) + func routesDuckDBFile(ext: String) { + let fileURL = URL(fileURLWithPath: "/tmp/warehouse.\(ext)") + let intent = URLClassifier.classify(fileURL) + guard case .some(.success(.openDatabaseFile(let routed, let dbType))) = intent else { + Issue.record("Expected .openDatabaseFile, got \(String(describing: intent))") + return + } + #expect(routed == fileURL) + #expect(dbType == .duckdb) + } + + @Test("Unknown file extension returns nil") + func returnsNilForUnknownExtension() { + let intent = URLClassifier.classify(URL(fileURLWithPath: "/tmp/file.xyz")) + #expect(intent == nil) + } }