cons

package
v1.2.5-beta10 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Mysql    = "mysql"
	Postgres = "postgres"
)
View Source
const (
	GtSubSQL = "sub_sql"
	GtOrder  = "order"
	GtKey    = "key"
	GtMock   = "mock"

	GtField      = "field"
	GtValid      = "valid"
	GtTrans      = "trans"
	GtIgnore     = "ignore"
	GtLike       = "like"
	Gt_          = "-"
	GtComma      = ","
	GtGorm       = "gorm"
	GtGormColumn = "column"
	GtExist      = "exist"
	GtSoftDel    = "soft_del"
)
View Source
const (
	ClientPage = 1
	EveryPage  = 10
)

default page

View Source
const (
	SQL_                = "SQL_"
	WhereS              = "where %s "
	AndS                = "and %s "
	OrderDesc           = "%s.id desc"
	OrderS              = "order by %s "
	And                 = " and "
	ParamAnd            = " = ?" + And
	ParamLike           = " like binary ? and "
	ParamInAnd          = " in (?) and "
	SelectFrom          = "select %s from %s "
	Distinct            = "distinct "
	Count               = "count(*) as total_num"
	CountDistinct       = "count(distinct %s) as total_num"
	SelectCount         = "select " + Count + " "
	SelectCountDistinct = "select " + CountDistinct + " "
	SelectCountFrom     = SelectCount + "from %s "
	SoftDel             = "%s.%s is not null and "
)

part sql

Variables

View Source
var (
	Driver                      = Mysql
	Backticks             uint8 = '`'    // different sql mark
	BackticksS                  = "`%s`" // different sql mark
	LikeKey                     = "like binary"
	GtClientPage                = "clientPage"
	GtClientPageUnderLine       = "client_page"
	GtEveryPage                 = "everyPage"
	GtEveryPageUnderLine        = "every_page"
)

default Mysql

Functions

func Init added in v1.2.3

func Init(driver string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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