You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
CREATETABLEauthors (
id BIGSERIALPRIMARY KEY,
names text[][] NOT NULL,
bio text
);
…#2338)
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.
https://www.postgresql.org/docs/14/arrays.html
Fixes issue: #1494
Replaces #1651#2308#2309
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
SQL queries
No response
Configuration
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
The text was updated successfully, but these errors were encountered: