Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Type overriding does not work for uuid, causes import conflict #1983

Answered by utkarshod
utkarshod asked this question in Q&A
Discussion options

I want to override the google uuid but when I try type overriding, it does not replace the google uuid but merely adds the new one to the imports of the models.go:

	"github.com/gofrs/uuid"
	"github.com/google/uuid"

This causes the following import error:

internal/queries/models.go:13:2: uuid redeclared in this block
	internal/queries/models.go:11:2: other declaration of uuid

I've tried version 1 (as following), version 2 and column overriding and yet I am unable to get the google uuid to stop being imported. Note: Type overriding works for me for another db type, just not uuid.

packages:
 - path: "internal/queries"
 name: "queries"
 engine: "postgresql"
 schema: "data/schema.sql"
 queries: "data/queries.sql"
 emit_methods_with_db_argument: true
 overrides:
 - go_type: "github.com/gofrs/uuid.UUID"
 db_type: "uuid"

Any suggestions / help would be greatly appreciated!

You must be logged in to vote

Replies: 1 comment

Comment options

Solved here

You must be logged in to vote
0 replies
Answer selected by utkarshod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /