Skip to content

Is there a tool to convert a sql script into a Golang SQL statement? #789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kaihendry opened this issue May 2, 2018 · 4 comments
Closed

Comments

@kaihendry
Copy link

Issue description

I'm puzzled how to run a client's multiline sql script he provides me in light of #258 (comment)

Example code

Here's a simple example, a script foobar.sql containing:


INSERT INTO `ut_test_foo_bar`(`foobar_invitation_id`) 
    VALUES 
    (@foo_bar_invitation_id);

Typically this file is hundreds of lines.

Error log

Tbh, I haven't even't figured out how to transform the quotes.

I'm manually reprogramming each line like so:

    result, err := db.Exec(
        "INSERT INTO ut_test_foo_bar (foobar_invitation_id) VALUES (?)",
        "blah blah blah",
    )

Which is super time consuming!!

Configuration

Driver version (or git SHA):

1a676ac

Go version: run go version in your console

go version go1.10.1 linux/amd64 (running Archlinux)

Server version: Server version: 5.7.12-log MySQL Community Server (GPL)

@methane
Copy link
Member

methane commented May 2, 2018

This is not Q&A site or user forum.
I know about MySQL protocol, but I don't know tools around Go's world.

@methane methane closed this as completed May 2, 2018
@kaihendry
Copy link
Author

Could you at least please point me to a good forum to get my question answered?

There is nothing on the README.md to guide me.

@methane
Copy link
Member

methane commented May 2, 2018

Google "go-nuts" or "gopher slack"

@kaihendry
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants