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.15.0
Running sqlc to generate go code results in an error: error generating code: source error: 22:9: expected type, found '-' (and 10 more errors)
error generating code: source error: 22:9: expected type, found '-' (and 10 more errors)
I believe the reason is that the table name contains "-" and sqlc tries to generate the struct with "-" in it, which is an illegal golang struct name.
Example ddl:
CREATE TABLE IF NOT EXISTS `x-info` ( `date` DATE NULL DEFAULT NULL, `meta` VARCHAR(50) NULL DEFAULT NULL, `count` INT(11) NULL DEFAULT NULL) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4;
-- name: Query :many SELECT * FROM `x-info` WHERE meta = ? ;
- path: "go/gen/sqlc/xmetricssqlc" name: "xmetricssqlc" engine: "mysql" schema: "ddl.sql" queries: "queries.sql"
No response
macOS
MySQL
Go
The text was updated successfully, but these errors were encountered:
Fixed https://play.sqlc.dev/p/5132c3b4c00aba7da20a15017b520853f97688ebe2a0da10b7ed388209c41a1f
Sorry, something went wrong.
No branches or pull requests
Version
1.15.0
What happened?
Running sqlc to generate go code results in an error:
error generating code: source error: 22:9: expected type, found '-' (and 10 more errors)
I believe the reason is that the table name contains "-" and sqlc tries to generate the struct with "-" in it, which is an illegal golang struct name.
Example ddl:
Relevant log output
Database schema
SQL queries
Configuration
Playground URL
No response
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: