jackc / pgtype

MIT License
308 stars 110 forks source link

Fixes #68 - Adds checks for zero length arrays/slices. #71

Closed haasanen closed 3 years ago

haasanen commented 3 years ago

Fixes #68

The problem:

The following code (or any other array/slice type!):

var t []uuid.UUID
tx.QueryRow(ctx, `select '{}'::uuid[]`).Scan(&t)

Causes the src struct in the AssignTo function to have Elements and Dimensions set as nil, but Status as Present.

The proposed solution:

jackc commented 3 years ago

Thanks!