Skip to content

Incorrect Casing of Field Names in SQLC Generated Code #2346

Closed
@DeepYV

Description

@DeepYV

Version

1.18.0

What happened?

In SQL query, I specified the field aliases in PascalCase, such as FilingName, StateCode, FilingType, and FilingID. However, when using SQLC to generate code, the field names in the generated code are not being converted to PascalCase as expected. Instead, they are being generated with initial lowercase letters Filingtype,filingtype, Filingid, Statecode

Relevant log output

It should be printed in PascalCase

Database schema

No response

SQL queries

-- name: ListFilingByEntityID :many
SELECT fc.filing_name       AS FilingName,
       fc.jurisdiction_code AS StateCode,
       fc.filing_type_code  AS FilingType,
       f.id                 AS FilingID
FROM filing_configuration.context fc
         JOIN entity.filing f ON fc.id = f.context_id
WHERE f.entity_id = @entity_id
  AND f.deleted_at is null;

Configuration

No response

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions