Skip to content

Sqlc will auto convent BookID to Bookid. It's a bug. #2392

Open
@ankisme

Description

@ankisme

Version

1.18.0

What happened?

My sql field is BookID, but sqlc will convert BookID to Bookid.

CREATE TABLE authors (
  id   BIGINT  NOT NULL AUTO_INCREMENT PRIMARY KEY,
  name text    NOT NULL,
  bio  text,
  BookID int
);
type Author struct {
	ID     int64
	Name   string
	Bio    sql.NullString
	Bookid sql.NullInt32
}

Maybe many people think that it is not a bug.

But I really think it is a bug.

I like BookID or BookId, and I don't like Bookid at all.

ThisIsAnExample is much more better than Thisisanexample.

AuthorName is much more better than Authorname.

And I could not found any configuration to forbid the auto rename.

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions