Closed jschaf closed 1 year ago
Previously, if a query returned a single nullable column, pggen would return the correct type *string, but only because we took the address of the input.
Bad code:
var item string if err := row.Scan(&item); err != nil { return &item, fmt.Errorf("query StringAggFirstName: %w", err) } return &item, nil
Fixed code:
var item *string if err := row.Scan(&item); err != nil { return item, fmt.Errorf("query StringAggFirstName: %w", err) } return item, nil
Fixes #75.
Previously, if a query returned a single nullable column, pggen would return the correct type *string, but only because we took the address of the input.
Bad code:
Fixed code:
Fixes #75.