sqlgenerator

package
v0.0.0-...-82d63aa Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQL

type SQL struct {
	TableName                string
	Columns                  []string
	SelectFields             []string
	ParamPlaceHolder         []string
	Params                   []*SQLParam
	Where                    string
	WhereParams              []*SQLParam
	ReturnAutoincrPrimaryKey string // insert 时是否返回自增主键
}

type SQLGenerator

type SQLGenerator interface {
	Insert(sql *SQL) (string, []*SQLParam)
	Update(sql *SQL) (string, []*SQLParam, []*SQLParam)
	Delete(sql *SQL) (string, []*SQLParam)
	Query(sql *SQL) (string, []*SQLParam)
}

func GetGenerator

func GetGenerator(dialect constants.DIALECT) (SQLGenerator, error)

type SQLParam

type SQLParam struct {
	VarName           string
	JSON              bool
	Time              bool
	Blob              bool // 实现了 BlobReadWriter
	SQLType           string
	VarAlias          string
	TimeProp          *dbutil.TimePropDesc
	SQLParamName      string // 从 SQL 语句中分析出来的参数名称,不作任何改变
	SQLParamFieldName string

	IsInOperator       bool
	InParamPlaceHolder string // in 操作符占位字符串
}

Jump to

Keyboard shortcuts

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