sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

feat: add support for Postgres multi dimensional arrays in Go

Open colli173 opened this issue 3 years ago • 2 comments

This PR adds support for generating model fields from multi-dimensional postgresql array columns. The approach here is to pass around an additional column attribute array_bounds representing the dimensions of the postgres array column. When generating code, the array_bounds is checked along is_array to determine the dimensions of the resulting struct field. Would be happy to hear alternative approaches or solutions here as well. More info: Postgres Arrays

fixes issue: https://github.com/kyleconroy/sqlc/issues/1494

colli173 avatar May 30 '22 19:05 colli173

The newest version of pgx/v5 has a generic Array type that we'll start to use as part of https://github.com/kyleconroy/sqlc/issues/1823.

We should only change the multi-dimension support for lib/pq.

kyleconroy avatar Aug 30 '22 15:08 kyleconroy

We should only change the multi-dimension support for lib/pq.

Thanks for taking a look. Could you clarify the ask here? Is there an aspect of this that should change for the lib/pq package?

colli173 avatar Sep 02 '22 18:09 colli173

@kyleconroy soft ping for another review when you have a chance.

colli173 avatar Mar 07 '23 22:03 colli173