// scan_helpers.go provides shared sql.Null* conversion helpers.
// Layer: adapters/outbound/postgres helper utilities.
package postgres

import (
	"database/sql"
	"time"
)

func stringValue(v sql.NullString) string {
	if !v.Valid {
		return ""
	}
	return v.String
}

func boolPtr(v sql.NullBool) *bool {
	if !v.Valid {
		return nil
	}
	b := v.Bool
	return &b
}

func float64Ptr(v sql.NullFloat64) *float64 {
	if !v.Valid {
		return nil
	}
	f := v.Float64
	return &f
}

func timePtr(v sql.NullTime) *time.Time {
	if !v.Valid {
		return nil
	}
	t := v.Time.UTC()
	return &t
}
