Skip to content

Named parameters for MySQL inserts / updates #3037

Description

@SebastienMelki

What do you want to change?

I'm trying to generate code based on queries like this

-- name: InsertPurchaseGuid :exec INSERT INTO purchase_guids (external_id, guid, created_at, updated_at, partner_id, payment_method_id) VALUES (:external_id, :guid, :created_at, :updated_at, :partner_id, :payment_method_id);

So that I can use the NamedExec function of the mysql driver. But whenever I run sqlc generate I get this error

db/queries/subs/insert_purchase_guid.sql:3:10: syntax error near ":external_id, :guid, :created_at, :updated_at, :partner_id, :payment_method_id);"

Is this not supported at all? Or am I doing it wrong?

Thank you!

What database engines need to be changed?

MySQL

What programming language backends need to be changed?

Go

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions