Documentation
¶
Overview ¶
Package pgtypes provides custom types for PostgreSQL database operations. It includes types for handling PostgreSQL-specific data types that need special conversion to/from Go types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interval ¶
type Interval struct {
// Duration is the Go time.Duration representation
Duration time.Duration
// Valid indicates whether the interval is NULL
Valid bool
}
Interval represents a PostgreSQL INTERVAL type that maps to Go's time.Duration. This type implements sql.Scanner and driver.Valuer interfaces to allow seamless conversion between PostgreSQL INTERVAL and Go time.Duration.
func NewInterval ¶
NewInterval creates a new Interval from a time.Duration
func ParseDuration ¶
ParseDuration parses a duration string (like "30m", "1h") and returns an Interval
func (*Interval) Scan ¶
Scan implements the sql.Scanner interface to read PostgreSQL INTERVAL values
Click to show internal directories.
Click to hide internal directories.