-
Notifications
You must be signed in to change notification settings - Fork 804
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
[proposal] Support LOAD DATA LOCAL INFILE for MySQL #2179
Comments
Some more thoughts:
|
In preparation of sqlc-dev#2179 for LOAD DATA LOCAL INFILE
This enables the :copyfrom query annotation for people using go-sql-driver/mysql that transforms it into a LOAD DATA LOCAL INFILE. issue sqlc-dev#2179
I have two PRs ready for this, and a documentation branch I'll send later. |
In preparation of sqlc-dev#2179 for LOAD DATA LOCAL INFILE
In preparation of sqlc-dev#2179 for LOAD DATA LOCAL INFILE
In preparation of sqlc-dev#2179 for LOAD DATA LOCAL INFILE
In preparation of sqlc-dev#2179 for LOAD DATA LOCAL INFILE
This enables the :copyfrom query annotation for people using go-sql-driver/mysql that transforms it into a LOAD DATA LOCAL INFILE. issue sqlc-dev#2179
In preparation of sqlc-dev#2179 for LOAD DATA LOCAL INFILE
This enables the :copyfrom query annotation for people using go-sql-driver/mysql that transforms it into a LOAD DATA LOCAL INFILE. issue sqlc-dev#2179
In preparation of #2179 for LOAD DATA LOCAL INFILE
This enables the :copyfrom query annotation for people using go-sql-driver/mysql that transforms it into a LOAD DATA LOCAL INFILE. issue sqlc-dev#2179
This enables the :copyfrom query annotation for people using go-sql-driver/mysql that transforms it into a LOAD DATA LOCAL INFILE. issue sqlc-dev#2179
This enables the :copyfrom query annotation for people using go-sql-driver/mysql that transforms it into a LOAD DATA LOCAL INFILE. issue sqlc-dev#2179
I need go-sql-driver/mysql to expose the *time.Location to encode correctly. @SnoozeThis go-sql-driver/mysql#1416 || go-sql-driver/mysql#1419 |
(https://snoozeth.is/NFrLngXswx4) I will either wait until go-sql-driver/mysql#1416 is closed or until go-sql-driver/mysql#1419 is merged and then add a comment. |
This enables the :copyfrom query annotation for people using go-sql-driver/mysql that transforms it into a LOAD DATA LOCAL INFILE. We don't have a way to get the timezone from the connection, so I've simply blocked people from using time.Times in their copyfrom. issue sqlc-dev#2179
An error occurred while snoozing: not found |
https://github.com/go-sql-driver/mysql#load-data-local-infile-support supports LOAD DATA LOCAL INFILE with an io.Reader.
We could implement the :copyfrom query annotation to use LOAD DATA LOCAL INFILE when using go-sql-driver. The generated code would call https://pkg.go.dev/github.com/go-sql-driver/mysql#RegisterReaderHandler with a new reader for this call (and deregister it afterwards).
I propose to keep the same :copyfrom name and semantics, even though that's technically incorrect for MySQL.
I've looked at the three MySQL drivers listed on https://github.com/golang/go/wiki/SQLDrivers and the other two don't seem to support LOAD DATA [LOCAL] INFILE, though they might support it in the future.
We'd probably want to add a setting where people can indicate which MySQL driver they're using so we can generate the code using the relevant package.
The text was updated successfully, but these errors were encountered: