We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.20.0
#2545 introduced a :copyfrom feature for MySQL database thanks to @kyleconroy . However, it is not woking well.
I think the cause of problem is parseDriver function never returns SQLDriverGoSQLDriverMySQL. https://github.com/sqlc-dev/sqlc/blob/faa1c9d156272eea4d33a31de2ab94951ba6af58/internal/codegen/golang/driver.go#L11C1-L35
parseDriver
SQLDriverGoSQLDriverMySQL
sqlc generate failed. # package db error generating code: :copyfrom is only supported by pgx and github.com/go-sql-driver/mysql
### Database schema ```sql CREATE TABLE authors ( id bigint PRIMARY KEY, name text NOT NULL, bio text );
-- name: BulkInsertAuthors :copyfrom INSERT INTO authors (id, name, bio) VALUES (?, ?, ?);
{ "version": "1", "packages": [ { "path": "db", "engine": "mysql", "schema": "query.sql", "queries": "query.sql" } ] }
https://play.sqlc.dev/p/ffd4ea54087e3ade2e02ae5ea9c9d76f00a9f34d0f649544c8ac716a0c1cfed0
macOS
MySQL
Go
The text was updated successfully, but these errors were encountered:
I misunderstood the problem. It was working well adding an option "sql_driver": "github.com/go-sql-driver/mysql" as below playground.
"sql_driver": "github.com/go-sql-driver/mysql"
https://play.sqlc.dev/p/9bf65cf825740ae06e585a0a25bc6a48154a660080d8cbb1af1a45d813255b21
Sorry, something went wrong.
As you discovered, you need to setthe sql_driver configuration option. We'll update the docs to make this clearer.
sql_driver
No branches or pull requests
Version
1.20.0
What happened?
#2545 introduced a :copyfrom feature for MySQL database thanks to @kyleconroy .
However, it is not woking well.
I think the cause of problem is
parseDriver
function never returnsSQLDriverGoSQLDriverMySQL
.https://github.com/sqlc-dev/sqlc/blob/faa1c9d156272eea4d33a31de2ab94951ba6af58/internal/codegen/golang/driver.go#L11C1-L35
Relevant log output
sqlc generate failed. # package db error generating code: :copyfrom is only supported by pgx and github.com/go-sql-driver/mysql
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/ffd4ea54087e3ade2e02ae5ea9c9d76f00a9f34d0f649544c8ac716a0c1cfed0
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: