Skip to content

generated files import github.com/tabbed/pqtype instead of github.com/sqlc-dev/pqtype #2663

@seferin-x

Description

@seferin-x

Version

1.20.0

What happened?

I just generated a new sql.go file. The file ref. a PSQL tabe that has a nullable JSON column.

In the exported file the import is:

import "github.com/tabbed/pqtype"

i work around by manually changing to:

import github.com/sqlc-dev/pqtype

Relevant log output

go mod tidy
go: finding module for package github.com/tabbed/pqtype
go: found github.com/tabbed/pqtype in github.com/tabbed/pqtype v0.2.0
go: github.com/xxxx/rbac/db imports
        github.com/tabbed/pqtype: github.com/tabbed/pqtype@v0.2.0: parsing go.mod:
        module declares its path as: github.com/sqlc-dev/pqtype
                but was required as: github.com/tabbed/pqtype

Database schema

CREATE TABLE "tenant" (
  "config_private" json
);

SQL queries

-- name: GetPublicConfig :one
SELECT
    config_public
FROM
    tenant
WHERE
    tag = $1;

Configuration

version: "2"
sql:
  - engine: "postgresql"
    queries: "db/sqlc"
    schema: "db/migrations"

    # https://github.com/gobuffalo/nulls
    
    gen:
      go:
        package: "db"
        out: "db"
        emit_json_tags: true
        emit_result_struct_pointers: true
        emit_empty_slices: true
        emit_prepared_queries: false
        emit_interface: true
        json_tags_case_style: "none"
        #emit_exact_table_names: true
        overrides:
          - db_type: "pg_catalog.int4"
            go_type: "github.com/gobuffalo/nulls.Int"
            nullable: true
          - db_type: "pg_catalog.int8"
            go_type: "github.com/gobuffalo/nulls.Int"
            nullable: true
          - db_type: "string"
            go_type: "github.com/gobuffalo/nulls.String"
            nullable: true
          - db_type: "pg_catalog.varchar"
            go_type: "github.com/gobuffalo/nulls.String"
            nullable: true
          - db_type: "text"
            go_type: "github.com/gobuffalo/nulls.String"
            nullable: true
          - db_type: "timestamptz"
            go_type: "github.com/gobuffalo/nulls.Time"
            nullable: true
          - db_type: "pg_catalog.timestamp"
            go_type: "github.com/gobuffalo/nulls.Time"
            nullable: true
          - db_type: "pg_catalog.timestamptz"
            go_type: "github.com/gobuffalo/nulls.Time"
            nullable: true
          - db_type: "date"
            go_type: "github.com/gobuffalo/nulls.Time"
            nullable: true
          - db_type: "pg_catalog.bool"
            go_type: "github.com/gobuffalo/nulls.Bool"
            nullable: true
          - db_type: "uuid"
            go_type: "github.com/gobuffalo/nulls.UUID"
            nullable: true
          - db_type: "pgtype.UUID"
            go_type: "github.com/gobuffalo/nulls.UUID"
            nullable: true

Playground URL

No response

What operating system are you using?

Windows

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions