Closed
Description
Version
1.24.0
What happened?
The code imports the unused "strings" package.
Relevant log output
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.24.0
// source: query.sql
package tutorial
import (
"context"
"strings"
)
const getAuthor = `-- name: GetAuthor :one
SELECT id, name, bio FROM authors
WHERE id = any($1)
`
func (q *Queries) GetAuthor(ctx context.Context, idList []int64) (Author, error) {
row := q.db.QueryRow(ctx, getAuthor, idList)
var i Author
err := row.Scan(&i.ID, &i.Name, &i.Bio)
return i, err
}
Database schema
CREATE TABLE authors (
id BIGSERIAL PRIMARY KEY,
name text NOT NULL,
bio text
);
SQL queries
-- name: GetAuthor :one
SELECT * FROM authors
WHERE id = any(sqlc.slice('id_list'));
Configuration
version: "2"
sql:
- engine: "postgresql"
queries: "query.sql"
schema: "schema.sql"
gen:
go:
package: "tutorial"
out: "tutorial"
sql_package: "pgx/v5"
Playground URL
https://play.sqlc.dev/p/7f1ba3b245cc4cbdf50a7512c4a598d701d80eda56de8ef60fd26393e3ca1605
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go