Fix SQL unmarshalling of optional nested structs (LEFT JOIN)

This commit is contained in:
2022-12-22 12:43:40 +01:00
parent 0cb2a977a0
commit 0112d681ac
20 changed files with 403 additions and 135 deletions

View File

@@ -62,7 +62,7 @@ func (s SubscriptionDB) Model() Subscription {
}
func DecodeSubscription(r *sqlx.Rows) (Subscription, error) {
data, err := sq.ScanSingle[SubscriptionDB](r, true)
data, err := sq.ScanSingle[SubscriptionDB](r, sq.SModeFast, sq.Safe, true)
if err != nil {
return Subscription{}, err
}
@@ -70,7 +70,7 @@ func DecodeSubscription(r *sqlx.Rows) (Subscription, error) {
}
func DecodeSubscriptions(r *sqlx.Rows) ([]Subscription, error) {
data, err := sq.ScanAll[SubscriptionDB](r, true)
data, err := sq.ScanAll[SubscriptionDB](r, sq.SModeFast, sq.Safe, true)
if err != nil {
return nil, err
}