Skip to content

fix(launch): stop claiming icon ownership of .sql, .sqlite, and .duckdb files#1595

Merged
datlechin merged 1 commit into
mainfrom
fix/1594-sql-duckdb-icon-ownership
Jun 5, 2026
Merged

fix(launch): stop claiming icon ownership of .sql, .sqlite, and .duckdb files#1595
datlechin merged 1 commit into
mainfrom
fix/1594-sql-duckdb-icon-ownership

Conversation

@datlechin

Copy link
Copy Markdown
Member

Fixes #1594

Problem

After installing TablePro, its icon appeared on .sql and .duckdb files in Finder even when TablePro was not the default app for those types.

Root cause

Info.plist exported three UTIs TablePro does not own: com.tablepro.sql, com.tablepro.sqlite-db, and com.tablepro.duckdb. An exported declaration tells Launch Services the app is the authority for that type, so Finder binds the extensions to TablePro's type and shows its icon regardless of the user's default app choice. LSHandlerRank=Owner on the SQL and DuckDB document types amplified the claim. The conformance references public.sql and com.apple.sqlite3 were dangling: neither UTI exists on macOS.

Fix

Per Apple's guidance (Tech Talk 10696, "Defining file and data types for your app"): export only types you created, import types invented elsewhere using the original identifier.

  • .sql: import org.iso.sql (the identifier Xcode, CotEditor, and BBEdit use), rank Owner to Default, drop the custom SQLDocument icon
  • .sqlite/.db: import org.sqlite.sqlite conforming to public.database and public.data, rank stays Alternate
  • .duckdb/.ddb: import org.duckdb.duckdb-database (format owner's reverse-DNS, per Apple convention), rank Owner to Default
  • All three document types use CFBundleTypeIconSystemGenerated
  • .tablepro and .tableplugin stay exported with Owner rank: TablePro owns those formats
  • Deleted the now-unreferenced SQLDocument.icns

No Swift code changes: the file-open pipeline (URLClassifier) dispatches on file extension strings and never consults UTIs. Verified open/save panels use UTType(filenameExtension:) dynamic lookup and keep working.

This matches what TablePlus, Sequel Ace, CotEditor, and BBEdit ship: Owner only for proprietary formats, no exported UTIs for formats they did not create.

Rollout

Launch Services re-registers the new declarations on first launch after update. No reboot needed. Finder's icon cache can lag; killall Finder refreshes it. User "Change All" default-app choices are preserved.

Tests

Added to URLClassifierTests: .sql routes to openSQLFile, .duckdb and .ddb route to openDatabaseFile with the DuckDB type, unknown extensions return nil. All pass. swiftlint --strict clean.

@datlechin datlechin merged commit cba82dd into main Jun 5, 2026
3 checks passed
@datlechin datlechin deleted the fix/1594-sql-duckdb-icon-ownership branch June 5, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TablePro icon used for sql and duckdb file types even when not set as the default app to open them with

1 participant