db

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

MySql引擎层

Index

Constants

This section is empty.

Variables

用squirrel生成sql语句

View Source
var Sqlx *sqlx.DB

sqlx 全局变量

Functions

func CreateLike

func CreateLike(column string) string

创建模糊查询

func CreatePage

func CreatePage(page, limit int) uint64

创建分页查询

func Model2Map

func Model2Map(m Model2MapParmas) (res map[string]interface{})

func NewSQLX

func NewSQLX(driverName, dbSource string, maxOpenConns, maxIdleConns int) (db *sqlx.DB, err error)

NewMySQL 创建一个连接MySQL的实体池

Types

type And

type And = squirrel.And

type Eq

type Eq = squirrel.Eq

type Gt

type Gt = squirrel.Gt

type GtOrEq

type GtOrEq = squirrel.GtOrEq

type Gte

type Gte = squirrel.GtOrEq

type InsertBuilder

type InsertBuilder = squirrel.InsertBuilder

type Like

type Like = squirrel.Like

type Lt

type Lt = squirrel.Lt

type LtOrEq

type LtOrEq = squirrel.LtOrEq

type Lte

type Lte = squirrel.LtOrEq

type Model2MapParmas

type Model2MapParmas struct {
	M                interface{}
	NeedZeroByInt    bool
	NeedZeroByString bool
	CreateTimeCol    string
	UpdateTimeCol    string
}

type NotEq

type NotEq = squirrel.NotEq

type Or

type Or = squirrel.Or

type SelectBuilder

type SelectBuilder = squirrel.SelectBuilder

type UpdateBuilder

type UpdateBuilder = squirrel.UpdateBuilder

Jump to

Keyboard shortcuts

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