Files
weatherapi/internal/adapters/postgres/scan.go
Eric Rakestraw cb316c228a
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
Added a /conditions/current endpoint with computed best-guess values for current conditions
2026-03-17 15:51:00 -05:00

47 lines
558 B
Go

package postgres
import (
"database/sql"
"time"
)
func ptrFloat64(v sql.NullFloat64) *float64 {
if !v.Valid {
return nil
}
f := v.Float64
return &f
}
func ptrString(v sql.NullString) *string {
if !v.Valid {
return nil
}
s := v.String
return &s
}
func ptrBool(v sql.NullBool) *bool {
if !v.Valid {
return nil
}
b := v.Bool
return &b
}
func ptrInt(v sql.NullInt64) *int {
if !v.Valid {
return nil
}
i := int(v.Int64)
return &i
}
func ptrTime(v sql.NullTime) *time.Time {
if !v.Valid {
return nil
}
t := v.Time
return &t
}