datatypes

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 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

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

func (Array[T]) Value

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

type Json map[string]any

func (Json) GormDataType

func (Json) GormDataType() string

func (*Json) Scan

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

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

func (Json) Value

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

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

type JsonArray

type JsonArray []map[string]any

func (*JsonArray) GormDataType

func (*JsonArray) GormDataType() string

func (*JsonArray) Scan

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

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

func (JsonArray) Value

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

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

type JsonB

type JsonB []byte

func (*JsonB) GormDataType

func (*JsonB) GormDataType() string

func (*JsonB) Scan

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

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

func (JsonB) Value

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

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

type JsonStr

type JsonStr string

func (*JsonStr) GormDataType

func (*JsonStr) GormDataType() string

func (*JsonStr) Scan

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

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

func (JsonStr) Value

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

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

type JsonT

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

func (*JsonT[T]) GormDataType

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

func (*JsonT[T]) Scan

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

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

func (JsonT[T]) Value

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

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

type JsonTArray

type JsonTArray[T any] []T

func (*JsonTArray[T]) GormDataType

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

func (*JsonTArray[T]) Scan

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

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

func (JsonTArray[T]) Value

func (j JsonTArray[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

type TimeArray []time.Time

func (*TimeArray) Scan

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

func (TimeArray) Value

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