sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Dynamically fetch the package name for single import strings

Open mrmelon54 opened this issue 1 year ago • 2 comments

What do you want to change?

This will fix issues with the single import string not chosing the correct package name

Example:

github.com/disgoorg/snowflake/v2.ID

This incorrectly produces v2.ID in the model when I would expect snowflake.ID

What database engines need to be changed?

No response

What programming language backends need to be changed?

Go

mrmelon54 avatar Mar 05 '24 20:03 mrmelon54

#3246 Small fix using some existing code

mrmelon54 avatar Mar 05 '24 21:03 mrmelon54

I had the same issue with github.com/oklog/ulid/v2 I solved it by having a local ulidx package with a type alias.

package ulidx

import "github.com/oklog/ulid/v2"

type ULID = ulid.ULID

tw1nk avatar Apr 29 '24 22:04 tw1nk