datatypes

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array[T any] []T

Array represents a PostgreSQL array for T. It implements the ArrayGetter and ArraySetter interfaces. It preserves PostgreSQL dimensions and custom lower bounds. Use FlatArray if these are not needed. 只支持一维数组,unsupported box

func (*Array[T]) Scan added in v1.2.8

func (d *Array[T]) Scan(value any) error

func (Array[T]) Value added in v1.2.8

func (d Array[T]) Value() (driver.Value, error)

type FloatArray

type FloatArray[T constraints.Float] []T

func (*FloatArray[T]) Scan

func (d *FloatArray[T]) Scan(value interface{}) error

func (FloatArray[T]) Value

func (d FloatArray[T]) Value() (driver.Value, error)

type IntArray

type IntArray[T constraints.Integer] []T

adpter postgres

func (*IntArray[T]) Scan

func (d *IntArray[T]) Scan(value interface{}) error

func (IntArray[T]) Value

func (d IntArray[T]) Value() (driver.Value, error)

type Json added in v1.2.11

type Json map[string]any

func (Json) GormDataType added in v1.2.11

func (Json) GormDataType() string

func (*Json) Scan added in v1.2.11

func (j *Json) Scan(value interface{}) error

实现 sql.Scanner 接口,Scan 将 value 扫描至 Json

func (Json) Value added in v1.2.11

func (j Json) Value() (driver.Value, error)

实现 driver.Valuer 接口,Value 返回 json value

type JsonArray added in v1.2.11

type JsonArray []map[string]any

func (*JsonArray) GormDataType added in v1.2.11

func (*JsonArray) GormDataType() string

func (*JsonArray) Scan added in v1.2.11

func (j *JsonArray) Scan(value interface{}) error

实现 sql.Scanner 接口,Scan 将 value 扫描至 Json

func (JsonArray) Value added in v1.2.11

func (j JsonArray) Value() (driver.Value, error)

实现 driver.Valuer 接口,Value 返回 json value

type JsonArrayT added in v1.2.11

type JsonArrayT[T any] []T

func (*JsonArrayT[T]) GormDataType added in v1.2.11

func (*JsonArrayT[T]) GormDataType() string

func (*JsonArrayT[T]) Scan added in v1.2.11

func (j *JsonArrayT[T]) Scan(value interface{}) error

实现 sql.Scanner 接口,Scan 将 value 扫描至 Json

func (JsonArrayT[T]) Value added in v1.2.11

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

实现 driver.Valuer 接口,Value 返回 json value

type JsonB added in v1.2.11

type JsonB []byte

func (*JsonB) GormDataType added in v1.2.11

func (*JsonB) GormDataType() string

func (*JsonB) Scan added in v1.2.11

func (j *JsonB) Scan(value interface{}) error

实现 sql.Scanner 接口,Scan 将 value 扫描至 JsonB

func (JsonB) Value added in v1.2.11

func (j JsonB) Value() (driver.Value, error)

实现 driver.Valuer 接口,Value 返回 json value

type JsonStr added in v1.2.11

type JsonStr string

func (*JsonStr) GormDataType added in v1.2.11

func (*JsonStr) GormDataType() string

func (*JsonStr) Scan added in v1.2.11

func (j *JsonStr) Scan(value interface{}) error

实现 sql.Scanner 接口,Scan 将 value 扫描至 JsonStr

func (JsonStr) Value added in v1.2.11

func (j JsonStr) Value() (driver.Value, error)

实现 driver.Valuer 接口,Value 返回 json value

type JsonT added in v1.2.11

type JsonT[T any] struct {
	Json *T
}

func (*JsonT[T]) GormDataType added in v1.2.11

func (*JsonT[T]) GormDataType() string

func (*JsonT[T]) Scan added in v1.2.11

func (j *JsonT[T]) Scan(value interface{}) error

实现 sql.Scanner 接口,Scan 将 value 扫描至 Json

func (JsonT[T]) Value added in v1.2.11

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

实现 driver.Valuer 接口,Value 返回 json value

type StringArray

type StringArray []string

func (*StringArray) Scan

func (d *StringArray) Scan(value interface{}) error

func (StringArray) Value

func (d StringArray) Value() (driver.Value, error)

type TimeArray added in v1.6.11

type TimeArray []time.Time

func (*TimeArray) Scan added in v1.6.11

func (d *TimeArray) Scan(value interface{}) error

func (TimeArray) Value added in v1.6.11

func (d TimeArray) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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