mysql

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AboveOpr

func AboveOpr(name string, val interface{}) string

AboveOpr AboveOpr

func BelowOpr

func BelowOpr(name string, val interface{}) string

BelowOpr BelowOpr

func EqualOpr

func EqualOpr(name string, val interface{}) string

EqualOpr EqualOpr

func InOpr

func InOpr(name string, val interface{}) string

InOpr InOpr

func IsKeyWord

func IsKeyWord(str string) bool

IsKeyWord check if a keyword

func LikeOpr

func LikeOpr(name string, val interface{}) string

LikeOpr LikeOpr

func NotEqualOpr

func NotEqualOpr(name string, val interface{}) string

NotEqualOpr NotEqualOpr

func NotInOpr

func NotInOpr(name string, val interface{}) string

NotInOpr NotInOpr

func SortOpr added in v1.2.0

func SortOpr(name string, ascSort bool) string

SortOpr sort opr

Types

type Builder

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

Builder Builder

func New

func New(vModel model.Model, modelProvider provider.Provider) *Builder

New create builder

func (*Builder) BuildBatchQuery

func (s *Builder) BuildBatchQuery(filter model.Filter) (ret string, err error)

BuildBatchQuery BuildBatchQuery

func (*Builder) BuildCount

func (s *Builder) BuildCount(filter model.Filter) (ret string, err error)

BuildCount BuildCount

func (*Builder) BuildCreateRelationSchema

func (s *Builder) BuildCreateRelationSchema(fieldName string, relationInfo model.Model) (string, error)

BuildCreateRelationSchema Build CreateRelation Schema

func (*Builder) BuildCreateSchema

func (s *Builder) BuildCreateSchema() (ret string, err error)

BuildCreateSchema BuildCreateSchema

func (*Builder) BuildDelete

func (s *Builder) BuildDelete() (ret string, err error)

BuildDelete BuildDelete

func (*Builder) BuildDeleteRelation

func (s *Builder) BuildDeleteRelation(fieldName string, relationInfo model.Model) (delRight, delRelation string, err error)

BuildDeleteRelation BuildDeleteRelation

func (*Builder) BuildDropRelationSchema

func (s *Builder) BuildDropRelationSchema(fieldName string, relationInfo model.Model) (string, error)

BuildDropRelationSchema Build DropRelation Schema

func (*Builder) BuildDropSchema

func (s *Builder) BuildDropSchema() (string, error)

BuildDropSchema BuildDropSchema

func (*Builder) BuildInsert

func (s *Builder) BuildInsert() (ret string, err error)

BuildInsert BuildInsert

func (*Builder) BuildInsertRelation

func (s *Builder) BuildInsertRelation(fieldName string, relationInfo model.Model) (ret string, err error)

BuildInsertRelation BuildInsertRelation

func (*Builder) BuildQuery

func (s *Builder) BuildQuery(filter model.Filter) (ret string, err error)

BuildQuery BuildQuery

func (*Builder) BuildQueryRelation

func (s *Builder) BuildQueryRelation(fieldName string, relationInfo model.Model) (ret string, err error)

BuildQueryRelation BuildQueryRelation

func (*Builder) BuildUpdate

func (s *Builder) BuildUpdate() (ret string, err error)

BuildUpdate BuildUpdate

func (*Builder) GetInitializeValue

func (s *Builder) GetInitializeValue(field model.Field) (ret interface{}, err error)

func (*Builder) GetRelationTableName

func (s *Builder) GetRelationTableName(fieldName string, relationInfo model.Model) string

func (*Builder) GetTableName

func (s *Builder) GetTableName() string

GetTableName GetTableName

type Config

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

func NewConfig

func NewConfig(dbAddress, dbName, username, password string) *Config

func (*Config) Database

func (s *Config) Database() string

func (*Config) HostAddress

func (s *Config) HostAddress() string

func (*Config) Password

func (s *Config) Password() string

func (*Config) Same

func (s *Config) Same(cfg executor.Config) bool

func (*Config) Username

func (s *Config) Username() string

type Executor

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

Executor Executor

func NewExecutor

func NewExecutor(config executor.Config) (ret *Executor, err error)

NewExecutor 新建一个数据访问对象

func (*Executor) BeginTransaction

func (s *Executor) BeginTransaction() (err error)

BeginTransaction Begin Transaction

func (*Executor) CheckTableExist

func (s *Executor) CheckTableExist(tableName string) (ret bool, err error)

CheckTableExist CheckTableExist

func (*Executor) CommitTransaction

func (s *Executor) CommitTransaction() (err error)

CommitTransaction Commit Transaction

func (*Executor) Connect

func (s *Executor) Connect() (err error)

Connect connect database

func (*Executor) Delete

func (s *Executor) Delete(sql string) (ret int64, err error)

Delete Delete

func (*Executor) Execute

func (s *Executor) Execute(sql string) (ret int64, err error)

Execute Execute

func (*Executor) Finish

func (s *Executor) Finish()

Finish Finish

func (*Executor) GetField

func (s *Executor) GetField(value ...interface{}) (err error)

GetField GetField

func (*Executor) Insert

func (s *Executor) Insert(sql string) (ret int64, err error)

Insert Insert

func (*Executor) Next

func (s *Executor) Next() bool

Next Next

func (*Executor) Ping

func (s *Executor) Ping() (err error)

Ping ping connection

func (*Executor) Query

func (s *Executor) Query(sql string) (err error)

Query Query

func (*Executor) Release

func (s *Executor) Release()

Release Release

func (*Executor) RollbackTransaction

func (s *Executor) RollbackTransaction() (err error)

RollbackTransaction Rollback Transaction

func (*Executor) Update

func (s *Executor) Update(sql string) (ret int64, err error)

Update Update

type Pool

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

Pool executorPool

func NewPool

func NewPool() *Pool

NewPool new pool

func (*Pool) CheckConfig

func (s *Pool) CheckConfig(cfgPtr executor.Config) error

func (*Pool) GetExecutor

func (s *Pool) GetExecutor() (ret executor.Executor, err error)

func (*Pool) Initialize

func (s *Pool) Initialize(maxConnNum int, cfgPtr executor.Config) (err error)

Initialize initialize executor pool

func (*Pool) Uninitialize

func (s *Pool) Uninitialize()

Uninitialize uninitialize executor pool

Jump to

Keyboard shortcuts

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