Skip to content

Postgresql 2D array in database schema generated as 1D array in models.go #1494

Closed
@colli173

Description

@colli173

Version

1.12.0

What happened?

go version: 1.18 (equal results with 1.17.8)

Using TEXT[][] as the column type in postgresql generates a corresponding model with field of type []string, when expected model should contain field of type [][]string. Apologies if this is a known limitation of sqlc.

Relevant log output

No response

Database schema

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  names text[][]      NOT NULL,
  bio  text
);

SQL queries

No response

Configuration

{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "postgresql",
      "schema": "query.sql",
      "queries": "query.sql",
      "sql_package": "pgx/v4"
    }
  ]
}

Playground URL

https://play.sqlc.dev/p/c29f1f2e8507033785a2753a7526650bb2c593370d66c5eed44cbc07e5aca2ea

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions