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

engine: sqlite json_each parameter not getting replaced with positional parameter #3785

Open
lumosminima opened this issue Jan 14, 2025 · 0 comments

Comments

@lumosminima
Copy link

Version

1.27.0

What happened?

I've also reported this on sqlc-dev/sqlc-gen-typescript#53.

Relevant log output

const getAuthor = `-- name: GetAuthor :one
SELECT id, name, bio FROM authors
WHERE id = ?1 AND (
      ?2 IS NULL
      OR name IN (
        SELECT value
        FROM json_each(@names)
      )
    ) LIMIT 1
`

Database schema

No response

SQL queries

-- name: GetAuthor :one
SELECT * FROM authors
WHERE id = @id AND (
      @name IS NULL
      OR name IN (
        SELECT value
        FROM json_each(@names)
      )
    ) LIMIT 1;

Configuration

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

Playground URL

https://play.sqlc.dev/p/8c9eef14c721c93dbf457729132606f6a7011193f13ad3f20b0ed006ccd40050

What operating system are you using?

Linux

What database engines are you using?

SQLite

What type of code are you generating?

Go

@lumosminima lumosminima added the bug Something isn't working label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant