datatype

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeletedAt

type DeletedAt int64

DeletedAt 使用 0 表示有效记录,使用 Unix 毫秒时间戳表示已删除记录。

func (DeletedAt) DeleteClauses

func (DeletedAt) DeleteClauses(field *schema.Field) []clause.Interface

func (DeletedAt) GormDBDataType

func (DeletedAt) GormDBDataType(db *gorm.DB, _ *schema.Field) string

func (DeletedAt) GormDataType

func (DeletedAt) GormDataType() string

func (DeletedAt) MarshalJSON

func (x DeletedAt) MarshalJSON() ([]byte, error)

func (DeletedAt) QueryClauses

func (DeletedAt) QueryClauses(field *schema.Field) []clause.Interface

func (*DeletedAt) Scan

func (x *DeletedAt) Scan(value any) error

func (*DeletedAt) UnmarshalJSON

func (x *DeletedAt) UnmarshalJSON(bytes []byte) error

func (DeletedAt) UpdateClauses

func (DeletedAt) UpdateClauses(field *schema.Field) []clause.Interface

func (DeletedAt) Value

func (x DeletedAt) Value() (driver.Value, error)

type Field

type Field interface {
	sql.Scanner
	driver.Valuer

	json.Marshaler
	json.Unmarshaler
}

type JSON

type JSON json.RawMessage

JSON 是可直接持久化并通过 gjson 路径读取的原始 JSON 文档。

func (JSON) Get

func (x JSON) Get(path string) gjson.Result

Get 使用 gjson 路径语法读取文档中的值。

func (JSON) GormDBDataType

func (JSON) GormDBDataType(db *gorm.DB, _ *schema.Field) string

func (JSON) GormDataType

func (JSON) GormDataType() string

func (JSON) GormValue

func (x JSON) GormValue(_ context.Context, db *gorm.DB) clause.Expr

func (JSON) MarshalJSON

func (x JSON) MarshalJSON() ([]byte, error)

func (JSON) Parse

func (x JSON) Parse() gjson.Result

Parse 将完整文档解析为可继续查询的 gjson Result。

func (*JSON) Scan

func (x *JSON) Scan(value any) error

Scan 从数据库读取 JSON,并复制驱动可能复用的字节缓冲区。

func (JSON) String

func (x JSON) String() string

func (*JSON) UnmarshalJSON

func (x *JSON) UnmarshalJSON(bytes []byte) error

func (JSON) Valid

func (x JSON) Valid() bool

Valid 判断当前值是否为完整且合法的 JSON 文档。

func (JSON) Value

func (x JSON) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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