Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not recognizing sqlc.arg after ON CONFLICT. #3334

Open
mondy opened this issue Apr 13, 2024 · 0 comments
Open

Not recognizing sqlc.arg after ON CONFLICT. #3334

mondy opened this issue Apr 13, 2024 · 0 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@mondy
Copy link

mondy commented Apr 13, 2024

Version

1.26.0

What happened?

Input:

-- name: Insert :exec
INSERT INTO authors (name)
VALUES (sqlc.arg(name))
ON CONFLICT (name) DO UPDATE SET data = sqlc.arg(data);

Output:

const insert = `-- name: Insert :exec
INSERT INTO authors (name)
VALUES (?1)
ON CONFLICT (name) DO UPDATE SET data = sqlc.arg(data)
`

sqlc.arg(name) is recognized, but sqlc.arg(data) is not recognized.

Relevant log output

No response

Database schema

CREATE TABLE authors (
  name TEXT NOT NULL UNIQUE,
  data BLOB NOT NULL
);

SQL queries

-- name: Insert :exec
INSERT INTO authors (name)
VALUES (sqlc.arg(name))
ON CONFLICT (name) DO UPDATE SET data = sqlc.arg(data);

Configuration

{
  "version": "2",
  "sql": [{
    "schema": "schema.sql",
    "queries": "query.sql",
    "engine": "sqlite",
    "gen": {
      "go": {
        "out": "db"
      }
    }
  }]
}

Playground URL

https://play.sqlc.dev/p/499d67e9cbdb4e01b7b2be3310bdc5d48e1e2154afc581eb48018e001f05beaf

What operating system are you using?

Windows

What database engines are you using?

SQLite

What type of code are you generating?

Go

@mondy mondy added bug Something isn't working triage New issues that hasn't been reviewed labels Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

1 participant