db

package
v0.0.0-...-33c5ed1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Driver      string `yaml:"driver"`
	Url         string `yaml:"url"`
	IdleConn    int    `yaml:"idle_conn"`
	OpenConn    int    `yaml:"open_conn"`
	MaxLifetime int    `yaml:"max_lifetime"`
}

数据库配置

type Engine

type Engine struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(conf *Config) (*Engine, error)

func (*Engine) XCount

func (e *Engine) XCount() (int, error)

func (*Engine) XCount64

func (e *Engine) XCount64() (int64, error)

func (*Engine) XMapFirst

func (e *Engine) XMapFirst() ([]map[string]interface{}, error)

func (*Engine) XMapList

func (e *Engine) XMapList() ([]map[string]interface{}, error)

func (*Engine) XModel

func (e *Engine) XModel(value interface{}) *Engine

X系列函数 使用简便的链式调用

func (*Engine) XOrder

func (e *Engine) XOrder(sort string) *Engine

func (*Engine) XWhere

func (e *Engine) XWhere(query interface{}, args ...interface{}) *Engine

func (*Engine) XWithPage

func (e *Engine) XWithPage(page, pageSize int) *Engine

Jump to

Keyboard shortcuts

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