orm

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "gorm"

Variables

This section is empty.

Functions

func List

func List() (dt map[string]Factory)

func Register

func Register(name string, broker Factory)

Types

type Cfg

type Cfg struct {
	Driver                                   string        `json:"driver"`
	SkipDefaultTransaction                   bool          `json:"skip_default_transaction"`
	FullSaveAssociations                     bool          `json:"full_save_associations"`
	DryRun                                   bool          `json:"dry_run"`
	PrepareStmt                              bool          `json:"prepare_stmt"`
	DisableAutomaticPing                     bool          `json:"disable_automatic_ping"`
	DisableForeignKeyConstraintWhenMigrating bool          `json:"disable_foreign_key_constraint_when_migrating"`
	DisableNestedTransaction                 bool          `json:"disable_nested_transaction"`
	AllowGlobalUpdate                        bool          `json:"allow_global_update"`
	QueryFields                              bool          `json:"query_fields"`
	CreateBatchSize                          int           `json:"create_batch_size"`
	MaxConnTime                              time.Duration `json:"max_conn_time" yaml:"max_conn_time"`
	MaxConnIdle                              int           `json:"max_conn_idle" yaml:"max_conn_idle"`
	MaxConnOpen                              int           `json:"max_conn_open" yaml:"max_conn_open"`
}

func DefaultCfg

func DefaultCfg() *Cfg

func (Cfg) Build

func (t Cfg) Build(dialect gorm.Dialector) *gorm.DB

type Client

type Client struct {
	*gorm.DB
}

func (*Client) Close

func (c *Client) Close() error

func (Client) Kind

func (c Client) Kind() string

func (*Client) Ping added in v0.1.7

func (c *Client) Ping() error

func (Client) UpdateResObj

func (c Client) UpdateResObj(val interface{})

type Factory

type Factory func(cfg types.CfgMap) gorm.Dialector

type JSON

type JSON json.RawMessage

func (JSON) GormDataType

func (JSON) GormDataType() string

func (*JSON) Scan

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

Scan scan value into Jsonb, implements sql.Scanner interface

func (JSON) Value

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

Value return json value, implement driver.Valuer interface

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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