Skip to content

feat: associate .psql and .pgsql files with the SQL editor#1641

Merged
datlechin merged 2 commits into
TableProApp:mainfrom
salmonumbrella:feat/psql-file-association
Jun 10, 2026
Merged

feat: associate .psql and .pgsql files with the SQL editor#1641
datlechin merged 2 commits into
TableProApp:mainfrom
salmonumbrella:feat/psql-file-association

Conversation

@salmonumbrella

Copy link
Copy Markdown
Contributor

What

Adds .psql and .pgsql to the SQL File document type so PostgreSQL script files open in TablePro's SQL editor, the same as .sql.

Why

.psql (the psql client) and .pgsql (VS Code's PostgreSQL default) are the conventional extensions for PostgreSQL SQL scripts. They're plain SQL, so they belong under the existing org.iso.sql type rather than falling back to a dynamic UTI with no handler. Today double-clicking one of these files doesn't route to TablePro.

Changes

  • TablePro/Info.plist: add psql and pgsql to
    • the SQL File CFBundleDocumentTypesCFBundleTypeExtensions
    • the org.iso.sql imported-type UTTypeTagSpecificationpublic.filename-extension
  • CHANGELOG.md: note under [Unreleased] → Added

Both extensions map to the existing org.iso.sql UTI — no new UTI or driver work. Scoped deliberately to the standard-SQL Postgres extensions; dialect-specific ones (.hql, .cql) and overloaded ones (.ddl) are intentionally left out.

Checklist

  • Tests added or updated — n/a (no file-association test harness exists; change is a static Info.plist declaration, validated with plutil -lint)
  • CHANGELOG.md updated under [Unreleased]
  • Docs updated — no user-facing docs page enumerates associated file extensions
  • User-facing strings localized — n/a
  • No SwiftLint/SwiftFormat violations — no Swift changed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a84de0d25e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread TablePro/Info.plist
Comment on lines +17 to +18
<string>psql</string>
<string>pgsql</string>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Route the newly associated extensions

With these extensions advertised in CFBundleDocumentTypes, Finder will now deliver .psql/.pgsql files to AppDelegate.application(_:open:), but the launch path still classifies SQL files only when URLClassifier.classifyFile sees ext == "sql" (TablePro/Core/Services/Infrastructure/URLClassifier.swift). In that double-click/Open With scenario the new extensions are logged as unrecognized and never reach .openSQLFile, so the advertised association does not actually open them in the editor.

Useful? React with 👍 / 👎.

@datlechin datlechin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@datlechin datlechin merged commit 947ccb0 into TableProApp:main Jun 10, 2026
3 checks passed
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.

2 participants