If you accidentally create two queries with the same name the generated go code has an error about an 'ambiguous selector"
-- name: GetReportByID :one
SELECT * FROM abuse_report
WHERE id = $1;
-- name: GetReportByID :one
SELECT * FROM abuse_report
WHERE id = $1;
Produces in db.go:
if q.getReportByIDStmt, err = db.PrepareContext(ctx, getReportByID); err != nil {
return nil, fmt.Errorf("error preparing query GetReportByID: %w", err)
}
if q.getReportByIDStmt, err = db.PrepareContext(ctx, getReportByID); err != nil {
return nil, fmt.Errorf("error preparing query GetReportByID: %w", err)
}
which fails to compile:
"ambiguous selector q.getReportByIDStmt"
My expected behavior is sqlc fails generation with an error indicating there are multiple queries with the same name.
If you accidentally create two queries with the same name the generated go code has an error about an 'ambiguous selector"
Produces in db.go:
which fails to compile:
"ambiguous selector q.getReportByIDStmt"
My expected behavior is sqlc fails generation with an error indicating there are multiple queries with the same name.