jsonarray

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 9 Imported by: 0

README

jsonarray

Go Reference Go Report Card Maintainability Test Coverage

GORM JSON Array Types

Installation

go get github.com/brokeyourbike/jsonarray

Authors

Thanks

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONArray

type JSONArray[T any] []T

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

func (JSONArray[T]) GormDBDataType

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

GormDBDataType gorm db data type

func (JSONArray[T]) GormDataType

func (m JSONArray[T]) GormDataType() string

GormDataType gorm common data type

func (JSONArray[T]) GormValue

func (m JSONArray[T]) GormValue(ctx context.Context, db *gorm.DB) clause.Expr

func (JSONArray[T]) MarshalJSON

func (m JSONArray[T]) MarshalJSON() ([]byte, error)

MarshalJSON to output non base64 encoded []byte

func (*JSONArray[T]) Scan

func (m *JSONArray[T]) Scan(val interface{}) error

Scan scan value into Jsonb, implements sql.Scanner interface

func (*JSONArray[T]) UnmarshalJSON

func (m *JSONArray[T]) UnmarshalJSON(b []byte) error

UnmarshalJSON to deserialize []byte

func (JSONArray[T]) Value

func (m JSONArray[T]) 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