gorm

package
v3.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package gorm some useful tools for gorm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GzText

type GzText string

GzText store string with gzip into blob

func (*GzText) Scan

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

Scan db -> val

func (GzText) Value

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

Value val -> db

type JSON

type JSON []byte

JSON store json into blob

func (JSON) Equals

func (j JSON) Equals(j1 JSON) bool

Equals check whether equal to j1

func (JSON) IsNull

func (j JSON) IsNull() bool

IsNull check is value is null

func (JSON) Marshal

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

Marshal return the encoding by json

func (*JSON) Scan

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

Scan db -> val

func (*JSON) Unmarshal

func (j *JSON) Unmarshal(data []byte) error

Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. If v is nil or not a pointer, Unmarshal returns an InvalidUnmarshalError.

func (JSON) Value

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

Value val -> db

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger colored logger for gorm

func NewLogger

func NewLogger(formatter func(...any) []any, logger loggerItf) *Logger

NewLogger new gorm sql logger

func (*Logger) Print

func (l *Logger) Print(vs ...any)

Print print sql logger

Jump to

Keyboard shortcuts

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