sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

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

Open colli173 opened this issue 3 years ago • 0 comments

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

colli173 avatar Mar 18 '22 00:03 colli173