types

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HStore added in v0.13.0

type HStore map[string]null.Val[string]

HStore is a wrapper for transferring HStore values back and forth easily.

func (*HStore) Scan added in v0.13.0

func (h *HStore) Scan(value any) error

Scan implements the Scanner interface.

Note h is reallocated before the scan to clear existing values. If the hstore column's database value is NULL, then h is set to nil instead.

func (HStore) Value added in v0.13.0

func (h HStore) Value() (driver.Value, error)

Value implements the driver Valuer interface. Note if h is nil, the database column value will be set to NULL.

type JSON

type JSON[T any] struct {
	Val T
}

func NewJSON added in v0.13.0

func NewJSON[T any](val T) JSON[T]

func (JSON[T]) MarshalJSON

func (j JSON[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (JSON[T]) MarshalText

func (j JSON[T]) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*JSON[T]) Scan

func (j *JSON[T]) Scan(value any) error

Scan implements the Scanner interface.

func (*JSON[T]) UnmarshalJSON

func (j *JSON[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*JSON[T]) UnmarshalText

func (j *JSON[T]) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (JSON[T]) Value

func (j JSON[T]) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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