Skip to content

Structs names no have non-camel case attribute names #1319

Closed

Description

@kyleconroy

Version

1.11.0

What happened?

I'm not sure what happened, maybe because of the update to v1.11 but previously my sqlc generated structs used to have camel case attribute names like:

type SomeStruct struct {
    ThisShouldBeCamelCase string
}

but now, whenever I do sqlc generate, it generates the struct name in a non-camel case fashion

type SomeStruct struct {
    Thisshouldbecamelcase string
}

Relevant log output

No response

Database schema

-- Example queries for sqlc
CREATE TABLE authors (
  nameForBook text      NOT NULL
);

SQL queries

-- name: GetAuthor :one
SELECT * FROM authors;

Configuration

{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "mysql",
      "schema": "query.sql",
      "queries": "query.sql"
    }
  ]
}

Playground URL

https://play.sqlc.dev/p/ab9bd10aca020c2bbac0312a833d2e80d660f541f64fff706ca0a6720d5cac91

What operating system are you using?

macOS

What database engines are you using?

MySQL

What type of code are you generating?

Go

Activity

  1. added
    bugSomething isn't working
    triageNew issues that hasn't been reviewed
    and removed
    triageNew issues that hasn't been reviewed
    on Nov 30, 2021
  2. kyleconroy commented on Nov 30, 2021

    @kyleconroy
    CollaboratorAuthor

    I think this was caused by #1216

  3. macfisherman commented on Dec 15, 2021

    @macfisherman

    I am seeing this as well.

  4. self-assigned this
    on Dec 16, 2021
  5. modified the milestone: v1.12.0 on Jan 31, 2022
  6. zoranembroker commented on Feb 21, 2022

    @zoranembroker

    Same problem I am having with Postgres !

  7. skabbes commented on Apr 2, 2022

    @skabbes
    Contributor

    @zoranembroker make sure to "double quote" your columns on postgres in order to use mixed case.

    CREATE TABLE authors (
      "nameForBook" text NOT NULL
    );
  8. mportugal commented on Sep 30, 2022

    @mportugal

    Is there any update regarding this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions