Skip to content

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

@urandom

Description

@urandom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions