feat(bun): generate native Go array slices for PostgreSQL array columns

Bun's pgdialect scans/appends native slices directly, so array columns
(text[], integer[], uuid[], ...) always generate as plain []string,
[]int32, etc. with an explicit "array" bun tag, regardless of --types
(sqltypes/stdlib/baselib). The SqlXxxArray wrapper types are no longer
used for Bun array columns (gorm is unaffected and keeps using them).

Adds --array-nullable pointer_slice to represent nullable array columns
as *[]T instead of []T, so callers can distinguish SQL NULL (nil) from
'{}' (pointer to an empty slice). Verified end-to-end against a live
PostgreSQL instance for NULL/{}/populated arrays in every --types mode.

Closes #13
This commit is contained in:
Hein
2026-07-21 12:41:38 +02:00
parent 2cecb4c11c
commit 5d9ff5df03
65 changed files with 9584 additions and 167 deletions
+15
View File
@@ -71,6 +71,12 @@ github.com/jackc/pgx/v5/pgconn/ctxwatch
github.com/jackc/pgx/v5/pgconn/internal/bgreader
github.com/jackc/pgx/v5/pgproto3
github.com/jackc/pgx/v5/pgtype
github.com/jackc/pgx/v5/pgxpool
github.com/jackc/pgx/v5/stdlib
# github.com/jackc/puddle/v2 v2.2.2
## explicit; go 1.19
github.com/jackc/puddle/v2
github.com/jackc/puddle/v2/internal/genstack
# github.com/jinzhu/inflection v1.0.0
## explicit
github.com/jinzhu/inflection
@@ -143,9 +149,15 @@ github.com/uptrace/bun/dialect/feature
github.com/uptrace/bun/dialect/sqltype
github.com/uptrace/bun/extra/bunjson
github.com/uptrace/bun/internal
github.com/uptrace/bun/internal/ordered
github.com/uptrace/bun/internal/parser
github.com/uptrace/bun/internal/tagparser
github.com/uptrace/bun/migrate
github.com/uptrace/bun/migrate/sqlschema
github.com/uptrace/bun/schema
# github.com/uptrace/bun/dialect/pgdialect v1.2.18
## explicit; go 1.24.0
github.com/uptrace/bun/dialect/pgdialect
# github.com/vmihailenco/msgpack/v5 v5.4.1
## explicit; go 1.19
github.com/vmihailenco/msgpack/v5
@@ -158,6 +170,9 @@ github.com/vmihailenco/tagparser/v2/internal/parser
# golang.org/x/crypto v0.51.0
## explicit; go 1.25.0
golang.org/x/crypto/md4
# golang.org/x/sync v0.20.0
## explicit; go 1.25.0
golang.org/x/sync/semaphore
# golang.org/x/sys v0.44.0
## explicit; go 1.25.0
golang.org/x/sys/cpu