types

package
v0.0.0-...-b19370d Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNumeric

func IsNumeric(value any) bool

func PromoteToCommonNumericValues

func PromoteToCommonNumericValues(left, right any) (any, any, error)

func ValueAs

func ValueAs[T any](untypedValue any, err error) (*T, error)

Types

type Type

type Type int
const (
	TypeUnknown Type = iota
	TypeText
	TypeSmallInteger
	TypeInteger
	TypeBigInteger
	TypeReal
	TypeDoublePrecision
	TypeNumeric
	TypeBool
	TypeTimestampTz
	TypeAny
)

func PromoteToCommonNumericTypes

func PromoteToCommonNumericTypes(left, right Type) (Type, error)

func TypeKindFromValue

func TypeKindFromValue(value any) Type

func (Type) IsNumber

func (typ Type) IsNumber() bool

func (Type) PromoteToCommonType

func (typ Type) PromoteToCommonType(other Type) Type

func (Type) Refine

func (typ Type) Refine(value any) (Type, any, bool)

func (Type) String

func (typ Type) String() string

Jump to

Keyboard shortcuts

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