8000 FIX: Add 'case' to list of Swift keywords for Swift type generation by Sid-MB · Pull Request #956 · supabase/postgres-meta · GitHub
[go: up one dir, main page]

Skip to content

FIX: Add 'case' to list of Swift keywords for Swift type generation #956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2025

Conversation

Sid-MB
Copy link
Contributor
@Sid-MB Sid-MB commented Jul 12, 2025

What kind of change does this PR introduce?

Adds "case" to the list of Swift keywords so that a Postgres table with a column named 'case' won't cause the Swift type generation to produce invalid code.

What is the current behavior?

gen types swift with a table that has a column named 'case' will produce the following code:

public let case: String        // ERROR: Keyword 'case' cannot be used as an identifier here. 
                               // FIX: If this name is unavoidable, use backticks to escape it

What is the new behavior?

case will be encoded in backticks so there will be no error:

public let `case`: String

Additional context

--

@Sid-MB Sid-MB requested review from a team as code owners July 12, 2025 00:20
@soedirgo soedirgo enabled auto-merge (squash) July 12, 2025 03:03
@soedirgo soedirgo merged commit 003391e into supabase:master Jul 12, 2025
5 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 16232138796

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.117%

Totals Coverage Status
Change from base Build 16045733927: 0.0%
Covered Lines: 5179
Relevant Lines: 6720

💛 - Coveralls

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.

3 participants
0