null

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: AGPL-3.0 Imports: 5 Imported by: 1

Documentation

Overview

Package null implements typed adapters for Go values to nullable DB columns.

Index

Constants

This section is empty.

Variables

View Source
var (
	Ignore ignType
	Value  nullType
)

Functions

func If added in v0.8.3

func If[T any](v T, pred func(T) bool) any

func IfEq added in v0.8.3

func IfEq[T comparable](v, null T) any

func IfLe added in v0.8.3

func IfLe[T constraints.Ordered](v, cmpr T) any

func IfLt added in v0.8.3

func IfLt[T constraints.Ordered](v, cmpr T) any

Types

type Bool

type Bool struct {
	P    *bool
	Null bool
}

func (Bool) Scan

func (b Bool) Scan(value interface{}) error

func (Bool) Value

func (b Bool) Value() (driver.Value, error)

type Bytes

type Bytes struct {
	P       *[]byte
	ZeroLen bool
}

func (Bytes) Scan

func (s Bytes) Scan(value interface{}) error

func (Bytes) Value

func (s Bytes) Value() (driver.Value, error)

type Float32

type Float32 struct {
	P    *float32
	Null float32
	NaN  interface{}
}

func (Float32) Map added in v0.2.0

func (f Float32) Map(p *float32) Float32

func (Float32) Scan

func (f Float32) Scan(value interface{}) error

func (Float32) Value

func (f Float32) Value() (driver.Value, error)

type Float64

type Float64 struct {
	P    *float64
	Null float64
	NaN  interface{}
}

func (Float64) Map added in v0.2.0

func (f Float64) Map(p *float64) Float64

func (Float64) Scan

func (f Float64) Scan(value interface{}) error

func (Float64) Value

func (f Float64) Value() (driver.Value, error)

type Int

type Int struct {
	P    *int
	Null int
}

func (Int) Scan

func (i Int) Scan(value interface{}) error

func (Int) Value

func (i Int) Value() (driver.Value, error)

type Int16

type Int16 struct {
	P    *int16
	Null int16
}

func (Int16) Scan

func (i Int16) Scan(value interface{}) error

func (Int16) Value

func (i Int16) Value() (driver.Value, error)

type Int32

type Int32 struct {
	P    *int32
	Null int32
}

func (Int32) Scan

func (i Int32) Scan(value interface{}) error

func (Int32) Value

func (i Int32) Value() (driver.Value, error)

type Int64

type Int64 struct {
	P    *int64
	Null int64
}

func (Int64) Scan

func (i Int64) Scan(value interface{}) error

func (Int64) Value

func (i Int64) Value() (driver.Value, error)

type String

type String struct {
	P    *string
	Null string
}

func (String) Scan

func (s String) Scan(value interface{}) error

func (String) Value

func (s String) Value() (driver.Value, error)

type Time

type Time struct {
	P *time.Time
}

func (Time) Scan

func (s Time) Scan(value interface{}) error

func (Time) Value

func (s Time) Value() (driver.Value, error)

type UInt16

type UInt16 struct {
	P    *uint16
	Null uint16
}

func (UInt16) Scan

func (i UInt16) Scan(value interface{}) error

func (UInt16) Value

func (i UInt16) Value() (driver.Value, error)

type UInt32

type UInt32 struct {
	P    *uint32
	Null uint32
}

func (UInt32) Scan

func (i UInt32) Scan(value interface{}) error

func (UInt32) Value

func (i UInt32) Value() (driver.Value, error)

type UInt64

type UInt64 struct {
	P    *uint64
	Null uint64
}

func (UInt64) Scan

func (i UInt64) Scan(value interface{}) error

func (UInt64) Value

func (i UInt64) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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