Skip to content
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

feat(mysql): :copyfrom support via LOAD DATA INFILE #2545

Merged
merged 4 commits into from
Jul 30, 2023
Merged

Conversation

kyleconroy
Copy link
Collaborator

@kyleconroy kyleconroy commented Jul 30, 2023

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.

Fixes #2179

Jille and others added 2 commits June 25, 2023 23:14
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 #2179
if err := checkNoTimesForMySQLCopyFrom(queries); err != nil {
return nil, err
}
tctx.SQLDriver = SQLDriverGoSQLDriverMySQL
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a gross hack, but I don't want to change how parseDriver works right now.

@kyleconroy kyleconroy marked this pull request as ready for review July 30, 2023 20:18
@kyleconroy kyleconroy changed the title MySQL LOAD DATA INFILE: First version feat(mysql): :copyfrom support via LOAD DATA INFILE Jul 30, 2023
@kyleconroy kyleconroy merged commit 8424410 into main Jul 30, 2023
7 checks passed
@kyleconroy kyleconroy deleted the loaddata2 branch July 30, 2023 21:44
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

Successfully merging this pull request may close these issues.

[proposal] Support LOAD DATA LOCAL INFILE for MySQL
2 participants