Skip to content

Column does not exist with sqlite engine #2120

Description

@mgholam

Version

Other

What happened?

generate gives the following error on v1.17.2:

$ tools/sqlc generate
# package db
src/query.sql:20:1: column "CustomerName" does not exist

Relevant log output

No response

Database schema

CREATE TABLE IF NOT EXISTS contacts (
	pid	TEXT PRIMARY KEY,
	CustomerName	TEXT,
	CustomerGuid	TEXT,
	ProjectName	TEXT,
	ProjectGuid	TEXT,
	FirstName	TEXT,
	LastName	TEXT,
	Position	TEXT,
	Mobile	TEXT,
	Mobile2	TEXT,
	Phone	TEXT,
	Email	TEXT,
	Fax	TEXT,
	Comment	TEXT,
	isDeleted	INTEGER DEFAULT 0
);

SQL queries

-- name: InsertContact :one
INSERT INTO contacts (
pid,
CustomerName,
CustomerGuid,
ProjectName,
ProjectGuid,
FirstName,
LastName,
Position,
Mobile,
Mobile2,
Phone,
Email,
Fax,
Comment
)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
RETURNING *;


-- name: GetContacts :many
select * from contacts

Configuration

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

Playground URL

https://play.sqlc.dev/p/1f226b2bec6aa236e58bd8acd704e3fb73f32da225f9fa1e677faf760f80030f

What operating system are you using?

Linux

What database engines are you using?

No response

What type of code are you generating?

Go

Activity

  1. added
    bugSomething isn't working
    triageNew issues that hasn't been reviewed
    on Mar 1, 2023
  2. mgholam commented on Mar 1, 2023

    @mgholam
    Author

    If I change the column names to lowercase it works...

    -- name: InsertContact :one
    INSERT INTO contacts (
    pid,
    customername,
  3. UltraWelfare commented on Jun 25, 2023

    @UltraWelfare

    Just hit the same issue... Really weird, it seems like it doesn't like an uppercase character anywhere in the column names...

  4. added 2 commits that reference this issue on Jul 11, 2023
    857bf1e
    6a3ed8b
  5. added a commit that references this issue on Jul 26, 2023
    7ff8e6f
  6. added a commit that references this issue on Oct 13, 2025
    f93b296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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