types

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Numeric = NumericFormatter{}
	UUID    = UUIDFormatter{}
)

Functions

func Format

func Format(oid uint32, v any) (any, error)

Types

type NumericFormatter

type NumericFormatter struct{}

func (NumericFormatter) Format

func (NumericFormatter) Format(num pgtype.Numeric) (any, error)

Format coerces `pgtype.Numeric` to int or double depending on the exponent. Returns error when value is invalid.

type UUIDFormatter added in v0.7.5

type UUIDFormatter struct{}

func (UUIDFormatter) Format added in v0.7.5

func (UUIDFormatter) Format(v any) (string, error)

Format takes a slice of bytes and returns a UUID in string format Returns error when byte array cannot be parsed.

Jump to

Keyboard shortcuts

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