datatype

package module
v0.0.0-...-63b6ed5 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 11 Imported by: 0

README

GORM Datatype

Currently only supports PostgreSQL.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array[T strong.Type] []T

func (*Array[T]) GormDBDataType

func (*Array[T]) GormDBDataType(db *gorm.DB, _ *schema.Field) string

func (*Array[T]) GormDataType

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

func (*Array[T]) Scan

func (a *Array[T]) Scan(src any) error

func (Array[T]) Value

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

type ArrayString

type ArrayString []string

func (*ArrayString) GormDBDataType

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

func (*ArrayString) GormDataType

func (*ArrayString) GormDataType() string

func (*ArrayString) Scan

func (a *ArrayString) Scan(src any) error

func (ArrayString) Value

func (a ArrayString) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type INetAddr

type INetAddr netip.Addr

func (*INetAddr) GormDBDataType

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

func (*INetAddr) GormDataType

func (*INetAddr) GormDataType() string

func (*INetAddr) Scan

func (a *INetAddr) Scan(value any) error

Scan implements the sql.Scanner interface.

func (INetAddr) Value

func (a INetAddr) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type INetPrefix

type INetPrefix netip.Prefix

func (*INetPrefix) GormDBDataType

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

func (*INetPrefix) GormDataType

func (*INetPrefix) GormDataType() string

func (*INetPrefix) Scan

func (a *INetPrefix) Scan(value any) error

Scan implements the sql.Scanner interface.

func (INetPrefix) Value

func (a INetPrefix) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

type JSON

type JSON json.RawMessage

JSON defined JSON data type, need to implements driver.Valuer, sql.Scanner interface

func (*JSON) GormDBDataType

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

func (*JSON) GormDataType

func (*JSON) GormDataType() string

func (JSON) MarshalJSON

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

MarshalJSON to output non base64 encoded []byte

func (*JSON) Scan

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

Scan scan value into Jsonb, implements sql.Scanner interface

func (*JSON) UnmarshalJSON

func (j *JSON) UnmarshalJSON(b []byte) error

UnmarshalJSON to deserialize []byte

func (JSON) Value

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

Value return json value, implement driver.Valuer interface

Jump to

Keyboard shortcuts

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