Skip to content

Support for package aliases in type overrides #1274

@ryerson

Description

@ryerson

Version

1.10.0

What happened?

When adding a type override to sqlc.yaml, I'd like to be able to specify an alias for the package.

I'm trying to create a type override with a type from a generated package. The package name differs from its directory name, so the generated sqlc code can’t resolve the import. Is it possible for me to specify the correct package alias when declaring the override?

For example:

  - column: "schema.table.column"
    go_type:
      import: "path/to/package"
      alias: "package2"
      type: "GeneratedColumnType"

would generate the .sql.go import:
package2 "path/to/package"

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

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