snapshot of https://github.com/sqlc-dev/sqlc.git (main, 2026-09-16; blobs > 131072B omitted)
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
This commit is contained in:
143
internal/endtoend/testdata/params_duplicate/mysql/go/query.sql.go
vendored
Normal file
143
internal/endtoend/testdata/params_duplicate/mysql/go/query.sql.go
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.31.1
|
||||
// source: query.sql
|
||||
|
||||
package querytest
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
const selectUserByAgeCast = `-- name: SelectUserByAgeCast :many
|
||||
SELECT first_name FROM users
|
||||
WHERE age > CAST(? AS SIGNED)
|
||||
OR age < CAST(? AS SIGNED)
|
||||
`
|
||||
|
||||
type SelectUserByAgeCastParams struct {
|
||||
Threshold int64
|
||||
}
|
||||
|
||||
func (q *Queries) SelectUserByAgeCast(ctx context.Context, arg SelectUserByAgeCastParams) ([]sql.NullString, error) {
|
||||
rows, err := q.db.QueryContext(ctx, selectUserByAgeCast, arg.Threshold, arg.Threshold)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []sql.NullString
|
||||
for rows.Next() {
|
||||
var first_name sql.NullString
|
||||
if err := rows.Scan(&first_name); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, first_name)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const selectUserByID = `-- name: SelectUserByID :many
|
||||
SELECT first_name from
|
||||
users where (? = id OR ? = 0)
|
||||
`
|
||||
|
||||
type SelectUserByIDParams struct {
|
||||
ID int32
|
||||
}
|
||||
|
||||
func (q *Queries) SelectUserByID(ctx context.Context, arg SelectUserByIDParams) ([]sql.NullString, error) {
|
||||
rows, err := q.db.QueryContext(ctx, selectUserByID, arg.ID, arg.ID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []sql.NullString
|
||||
for rows.Next() {
|
||||
var first_name sql.NullString
|
||||
if err := rows.Scan(&first_name); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, first_name)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const selectUserByName = `-- name: SelectUserByName :many
|
||||
SELECT first_name
|
||||
FROM users
|
||||
WHERE first_name = ?
|
||||
OR last_name = ?
|
||||
`
|
||||
|
||||
type SelectUserByNameParams struct {
|
||||
Name sql.NullString
|
||||
}
|
||||
|
||||
func (q *Queries) SelectUserByName(ctx context.Context, arg SelectUserByNameParams) ([]sql.NullString, error) {
|
||||
rows, err := q.db.QueryContext(ctx, selectUserByName, arg.Name, arg.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []sql.NullString
|
||||
for rows.Next() {
|
||||
var first_name sql.NullString
|
||||
if err := rows.Scan(&first_name); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, first_name)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const selectUserQuestion = `-- name: SelectUserQuestion :many
|
||||
SELECT first_name from
|
||||
users where (? = id OR ? = 0)
|
||||
`
|
||||
|
||||
type SelectUserQuestionParams struct {
|
||||
ID int32
|
||||
Column2 any
|
||||
}
|
||||
|
||||
func (q *Queries) SelectUserQuestion(ctx context.Context, arg SelectUserQuestionParams) ([]sql.NullString, error) {
|
||||
rows, err := q.db.QueryContext(ctx, selectUserQuestion, arg.ID, arg.Column2)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []sql.NullString
|
||||
for rows.Next() {
|
||||
var first_name sql.NullString
|
||||
if err := rows.Scan(&first_name); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, first_name)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
Reference in New Issue
Block a user