database

package module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

pangu-database

盘古数据库适配

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionConfig added in v1.0.4

type ConnectionConfig struct {
	// 最大打开连接数
	MaxOpen int `default:"150" yaml:"maxOpen" json:"maxOpen"`
	// 最大休眠连接数
	MaxIdle int `default:"30" yaml:"maxIdle" json:"maxIdle"`
	// 每个连接最大存活时间
	MaxLifetime time.Duration `default:"5s" yaml:"maxLifetime" json:"maxLifetime"`
}

ConnectionConfig 连接池配置

type Engine added in v1.0.8

type Engine struct {
	*xorm.Engine
}

Engine 数据库引擎简单封装

type Session

type Session struct {
	*xorm.Session
}

Session 描述一个事务

type Tx

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

Tx 事务控制

func (*Tx) Do

func (t *Tx) Do(fun txFun, fields ...gox.Field) (err error)

func (*Tx) Dop

func (t *Tx) Dop(fun txpFun, params []interface{}, fields ...gox.Field) (err error)

Jump to

Keyboard shortcuts

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