lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.86k stars 908 forks source link

Rewrite the array.go to support generic array type? #1103

Open liur180855 opened 1 year ago

liur180855 commented 1 year ago

Hello,

AFAIK this is current use case of Generic Array

//  var x []sql.NullInt64
//  db.QueryRow(`SELECT ARRAY[235, 401]`).Scan(pq.Array(&x))

if we can rewrite or add another version of generic array to support the following use case in sqlx

type Foobar struct {
}

type Foo struct {
    Bar pq.GenericArrayV2[bool]
    Baz pq.GenericArrayV2[Foobar]
}