ormx

package
v5.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c DBConfig) (*gorm.DB, error)

New Create gorm.DB instance

Types

type DBConfig added in v5.8.0

type DBConfig struct {
	Debug        bool
	DBType       string
	DSN          string
	MaxLifetime  int
	MaxOpenConns int
	MaxIdleConns int
	TablePrefix  string
}

DBConfig GORM DBConfig

type JSONArr

type JSONArr json.RawMessage

func (*JSONArr) MarshalJSON

func (j *JSONArr) MarshalJSON() ([]byte, error)

func (*JSONArr) Scan

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

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

func (*JSONArr) UnmarshalJSON

func (j *JSONArr) UnmarshalJSON(data []byte) error

func (JSONArr) Value

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

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

type JSONObj

type JSONObj json.RawMessage

func (*JSONObj) MarshalJSON

func (j *JSONObj) MarshalJSON() ([]byte, error)

func (*JSONObj) Scan

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

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

func (*JSONObj) UnmarshalJSON

func (j *JSONObj) UnmarshalJSON(data []byte) error

func (JSONObj) Value

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

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

Jump to

Keyboard shortcuts

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