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.21.0
I think I find the minimal example that trigger the issue
https://play.sqlc.dev/p/3f394572c6d70a7216ec7e62480985911ca70ad94ff72501fa19c23dc3700844
If I have a field named uuid, that is a varchar(36)
varchar(36)
and I override all the columns *.uuid to use github.com/google/uuid.UUID
*.uuid
github.com/google/uuid.UUID
and I split model and querier files
and I have a query that uses more than one field (to force generate one composite struct type) and one of them is our uuid
it works fine with sqlc 1.20.0 but in the latest version
the generated code add an import on github.com/google/uuid.UUID in the querier, but it is not necessary on this specific file
and any validation such as go vet just point that we have an unused import
go vet
I am not sure if it happens with other databases or other types.
$ go vet ./... tutorial/models_sqlc.go:10:2: no required module provides package github.com/google/uuid; to add it: go get github.com/google/uuid
CREATE TABLE authors ( id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, name text NOT NULL, bio text, uuid varchar(36) );
-- name: FindAuthor :one SELECT * FROM authors WHERE name = ? AND uuid = ? LIMIT 1;
version: 2 overrides: go: overrides: - db_type: "json" go_type: type: "[]byte" # workaround sqlc bug when reading null json columns nullable: true - column: "*.uuid" go_type: "github.com/google/uuid.UUID" sql: - engine: "mysql" queries: "query.sql" schema: "schema.sql" gen: go: package: "tutorial" out: "tutorial" emit_db_tags: true emit_prepared_queries: true emit_interface: true emit_exact_table_names: false emit_empty_slices: false emit_exported_queries: true emit_json_tags: true emit_params_struct_pointers: false emit_methods_with_db_argument: false emit_enum_valid_method: true emit_all_enum_values: true json_tags_case_style: "camel" output_files_suffix: "_sqlc" output_db_file_name: "db_sqlc.go" output_models_file_name: "models_sqlc.go" output_querier_file_name: "querier_sqlc.go" rename: uuid: "UUID"
It does not support latest sqlc yet, it seems to return http error 500
Linux
MySQL
Go
The text was updated successfully, but these errors were encountered:
Ouch I think it is the same as #2707
Sorry, something went wrong.
Yes I think this is resolved on main as of yesterday when we merged #2709.
If you're able to go install @main and still see this issue please reopen.
@main
Yes I confirm, with sqlc@main the issue is fixed
sqlc@main
any chance to release a v1.21.1 @andrewmbenton ?
v1.21.1
No branches or pull requests
Version
1.21.0
What happened?
I think I find the minimal example that trigger the issue
https://play.sqlc.dev/p/3f394572c6d70a7216ec7e62480985911ca70ad94ff72501fa19c23dc3700844
If I have a field named uuid, that is a
varchar(36)
and I override all the columns
*.uuid
to usegithub.com/google/uuid.UUID
and I split model and querier files
and I have a query that uses more than one field (to force generate one composite struct type) and one of them is our uuid
it works fine with sqlc 1.20.0 but in the latest version
the generated code add an import on
github.com/google/uuid.UUID
in the querier, but it is not necessary on this specific fileand any validation such as
go vet
just point that we have an unused importI am not sure if it happens with other databases or other types.
Relevant log output
$ go vet ./... tutorial/models_sqlc.go:10:2: no required module provides package github.com/google/uuid; to add it: go get github.com/google/uuid
Database schema
SQL queries
Configuration
Playground URL
https://play.sqlc.dev/p/3f394572c6d70a7216ec7e62480985911ca70ad94ff72501fa19c23dc3700844
It does not support latest sqlc yet, it seems to return http error 500
What operating system are you using?
Linux
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: