pgxtypes

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidUUID      = errors.New("invalid UUID")
	ErrInvalidTimestamp = errors.New("invalid timestamp")
	ErrEmptyUUID        = errors.New("empty UUID string")
)

Functions

func NewUUID

func NewUUID() (pgtype.UUID, error)

NewUUID generates a new pgtype.UUID

func StringFromUUID

func StringFromUUID(u pgtype.UUID) (string, error)

StringFromUUID converts pgtype.UUID to string

func TimeFromTimestamp

func TimeFromTimestamp(ts pgtype.Timestamp) (time.Time, error)

TimeFromTimestamp converts pgtype.Timestamp to time.Time

func TimestampFromTime

func TimestampFromTime(t time.Time) (pgtype.Timestamp, error)

TimestampFromTime converts time.Time to pgtype.Timestamp

func TimestampFromTimePtr

func TimestampFromTimePtr(t *time.Time) (pgtype.Timestamp, error)

TimestampFromTimePtr converts time.Time pointer to pgtype.Timestamp, handling nil

func UUIDFromString

func UUIDFromString(s string) (pgtype.UUID, error)

UUIDFromString converts a string UUID to pgtype.UUID

func UUIDFromStringPtr

func UUIDFromStringPtr(s *string) (pgtype.UUID, error)

UUIDFromStringPtr converts a string pointer to pgtype.UUID, handling nil

func UUIDToBytes

func UUIDToBytes(s string) ([16]byte, error)

UUIDToBytes converts a string UUID to a UUID bytes representation for salt fields

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL