Skip to content

No quotes around column names in Postgres #1718

Closed
@gurleensethi

Description

@gurleensethi

Version

1.14.0

What happened?

SQLC is not adding quotes around columns in postgresql.

Query:

SELECT * FROM "Article";

Generated Query

SELECT id, title, publishDate FROM "Article";

No "" quotes around publishDate since it is camelCase 🤷‍♂️.

How can I get sqlc to generate query like this:

SELECT "id", "title", "publishDate" FROM "Article";

Relevant log output

No response

Database schema

No response

SQL queries

SELECT * FROM "Article";

Configuration

version: 2
sql:
- engine: "postgresql"
  schema: "./pkg/db/migrations"
  queries: "./pkg/db/queries.sql"
  gen:
    go:
      package: "dbgen"
      out: "./pkg/db/dbgen"
      json_tags_case_style: camelCase
      emit_db_tags: true

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

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions