Skip to content

Argument name for sqlc.arg() can't be SQL keyword #2832

Description

@sgtsquiggs

Version

1.21.0

What happened?

sqlc errors out complaining about arguments

Relevant log output

# package models
queries.sql:1:1: Invalid argument to sqlc.arg()

Database schema

create table "user_data" (
	"id" varchar not null,
	"user" varchar not null,
	primary key ("id")
);

SQL queries

-- name: StageUserData: copyfrom
insert into "user_data" ("id", "user")
values (sqlc.arg(id), sqlc.arg(user));

Configuration

version: "2"
sql:
  - engine: "postgresql"
    schema: "schema.sql"
    queries: "queries.sql"
    gen:
      go:
        package: "models"
        sql_package: "pgx/v5"
        out: "models"

Playground URL

https://play.sqlc.dev/p/0dc89e4177151eca415a86676469f9cef991c373455641ddbacef05abab3f265

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions