Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

emit_exported_queries results in const and func having the same name in query.sql.go #3970

Closed
Labels
🔧 golang bugSomething isn't working
@SunnysideAaron

Description

Version

1.29.0

What happened?

Just using the basic tutorial. pgx/v5 if it matters. Here is the generated output. Am I missing something? go doesn't allow a const and func to share the same name in the same scope.

const CreateAuthor = `-- name: CreateAuthor :one
INSERT INTO authors (
 name, bio
) VALUES (
 1,ドル 2ドル
)
RETURNING id, name, bio
`
type CreateAuthorParams struct {
	Name string
	Bio pgtype.Text
}
func (q *Queries) CreateAuthor(ctx context.Context, arg CreateAuthorParams) (Author, error) {
	row := q.db.QueryRow(ctx, CreateAuthor, arg.Name, arg.Bio)
	var i Author
	err := row.Scan(&i.ID, &i.Name, &i.Bio)
	return i, err
}

Relevant log output

Database schema

SQL queries

Configuration

Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔧 golang bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /