Skip to content

pgx/v5 ignores emit_pointers_for_null_types #1991

Closed
@mvrhov

Description

@mvrhov

Version

Other

What happened?

Latest main release as of writing this bug report.
pgx/v5 seems to always use the pgx/v5/pgtype and ignores the emit_pointers_for_null_types config option

Relevant log output

No response

Database schema

CREATE TABLE app (
    id_app bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
    user_app_id text NOT NULL,
    app_name text NOT NULL,
    description text,

    created_at timestamp(0) DEFAULT now() NOT NULL,
    updated_at timestamp(0),

    PRIMARY KEY(id_app)
);

SQL queries

-- name: CreateApp :one
INSERT INTO app (
    user_app_id, app_name, description
) VALUES (
    sqlc.arg('user_app_id'), sqlc.arg('app_name'), sqlc.arg('description')
)
RETURNING *;

Configuration

version: "2"
sql:
  - schema: "./cmd/store/migrations/schema/"
    queries: "./cmd/store/migrations/query/"
    engine: "postgresql"
    gen:
      go:
        package: "gensql"
        out: "pkg/gensql"
        sql_package: "pgx/v5"
        emit_db_tags: false
        emit_prepared_queries: false
        emit_interface: false
        emit_exact_table_names: true
        emit_empty_slices: false
        emit_exported_queries: false
        emit_json_tags: false
        emit_result_struct_pointers: true
        emit_params_struct_pointers: true
        emit_methods_with_db_argument: true
        emit_enum_valid_method: false
        emit_all_enum_values: true
        emit_pointers_for_null_types: true
        json_tags_case_style: "none"

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions