Skip to content

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
@kyleconroy kyleconroy deleted the loaddata2 branch July 30, 2023 21:44
alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
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. --------- Co-authored-by: Jille Timmermans <jille@quis.cx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants