sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Type override, where new type has an underlying basic type, results in an invalid import

Open urandom opened this issue 1 month ago • 0 comments

Version

1.30.0

What happened?

Given the following override definition:

...
      go:
        package: "somepackage"
...
          - column: "table.column"
            go_type: "github.com/import/from/within/the/module/somepackage/SomeType"

Where the column is of type TEXT, and the type is defined within the module and package where the result is being generated. The type definition is:

package somepackage

type SomeType string

The models.go generated file ends up with the following import line:

package somepackage

import (
...
	"github"

Ideally, it must not attempt to import anything, since the type is defined from within the package that houses the generated files.

Relevant log output


Database schema


SQL queries


Configuration


Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

urandom avatar Nov 21 '25 11:11 urandom