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

sqlc.slice() generates broken code when emit_prepared_queries is enabled #2430

Closed
SoMuchForSubtlety opened this issue Jul 11, 2023 · 0 comments · Fixed by #2431
Closed

sqlc.slice() generates broken code when emit_prepared_queries is enabled #2430

SoMuchForSubtlety opened this issue Jul 11, 2023 · 0 comments · Fixed by #2431
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@SoMuchForSubtlety
Copy link
Contributor

SoMuchForSubtlety commented Jul 11, 2023

Version

1.19.0

What happened?

pkg/db/my_table.sql.go:95:35: not enough arguments in call to q.query
        have (context.Context, string, []interface{})
        want (context.Context, *sql.Stmt, string, ...interface{})

Relevant log output

No response

Database schema

-- Example queries for sqlc
CREATE TABLE authors (
  name text      NOT NULL,
  bio  text
);

SQL queries

-- name: GetAuthorsBroken :many
SELECT * FROM authors
WHERE name in (sqlc.slice(names));

Configuration

version: 2
sql:
  - engine: "sqlite"
    schema: "pkg/db/migrations"
    queries: "pkg/db/queries"
    gen:
      go:
        emit_prepared_queries: true
        emit_db_tags: true
        package: "db"

Playground URL

https://play.sqlc.dev/p/cc0e82b9bf323ca2a1d8de4cd5d5aedaca0b7aac8dc7dc3f0df4105fe2fcb07a

What operating system are you using?

Linux

What database engines are you using?

SQLite

What type of code are you generating?

Go

@SoMuchForSubtlety SoMuchForSubtlety added bug Something isn't working triage New issues that hasn't been reviewed labels Jul 11, 2023
SoMuchForSubtlety added a commit to SoMuchForSubtlety/sqlc that referenced this issue Jul 11, 2023
SoMuchForSubtlety added a commit to SoMuchForSubtlety/sqlc that referenced this issue Jul 11, 2023
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

Successfully merging a pull request may close this issue.

1 participant