Documentation ¶
Index ¶
- type Batis
- func (b *Batis) AddFS(FS *embed.FS, name string) *Batis
- func (b *Batis) AddRaw(rawXML string) *Batis
- func (b *Batis) Begin() *TX
- func (b *Batis) DSN(dsn string) *Batis
- func (b *Batis) DSNWithDialect(dialect Dialect, dsn string) *Batis
- func (b *Batis) Mapper(binding string) *mapper
- func (b *Batis) SetConnMaxIdleTime(n time.Duration) *Batis
- func (b *Batis) SetConnMaxLifetime(n time.Duration) *Batis
- func (b *Batis) SetMaxIdleConn(n int) *Batis
- func (b *Batis) SetMaxOpenConn(n int) *Batis
- func (b *Batis) SqlQuery(sql string) *sqlQuery
- type DB
- type DS
- type Dialect
- type Helper
- type Page
- type PageMap
- type SelectMapper
- func (m *SelectMapper) Args(args ...interface{}) *SelectMapper
- func (m *SelectMapper) Exec() *selectCall
- func (m *SelectMapper) Page(rptr interface{}, offset, size int) *Page
- func (m *SelectMapper) PageMap(offset, size int) *PageMap
- func (m *SelectMapper) Prepare(data interface{}) *SelectMapper
- func (m *SelectMapper) PrepareWithFunc(data interface{}, funcMap template.FuncMap) *SelectMapper
- type TX
- type UpdateMapper
- func (m *UpdateMapper) AffectedRows() int64
- func (m *UpdateMapper) Args(args ...interface{}) *UpdateMapper
- func (m *UpdateMapper) Exec() error
- func (m *UpdateMapper) InsertedId() int64
- func (m *UpdateMapper) Prepare(data interface{}) *UpdateMapper
- func (m *UpdateMapper) PrepareWithFunc(data interface{}, funcMap template.FuncMap) *UpdateMapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batis ¶
type Batis struct { Logger *logrus.Logger MultiDS *multiDS FuncMap template.FuncMap // contains filtered or unexported fields }
Batis struct
func (*Batis) DSNWithDialect ¶
DSNWithDialect register dsn with master ds and dialect
func (*Batis) SetMaxIdleConn ¶
func (*Batis) SetMaxOpenConn ¶
type DS ¶
type DS struct { // Named of DS Name string // DSN of DS DSN string // contains filtered or unexported fields }
DS struct
type Dialect ¶
type Dialect string
const ( MySQL Dialect = "mysql" //see https://github.com/go-sql-driver/mysql SQLite Dialect = "sqlite3" //see https://github.com/mattn/go-sqlite3 SQLite3 Dialect = "sqlite3" //see https://github.com/mattn/go-sqlite3 MSSQL Dialect = "sqlserver" //see https://github.com/denisenkom/go-mssqldb )
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper struct
func NewHelperWithBatis ¶
NewHelperWithBatis return new helper with DS
func NewHelperWithBatisAndDS ¶
NewHelperWithBatisAndDS return new helper with DS
func NewHelperWithDS ¶
NewHelperWithDS return new helper with DS
type SelectMapper ¶
type SelectMapper struct {
// contains filtered or unexported fields
}
func (*SelectMapper) Args ¶
func (m *SelectMapper) Args(args ...interface{}) *SelectMapper
Args set args
func (*SelectMapper) Page ¶
func (m *SelectMapper) Page(rptr interface{}, offset, size int) *Page
Page select page
func (*SelectMapper) PageMap ¶
func (m *SelectMapper) PageMap(offset, size int) *PageMap
PageMap select Page
func (*SelectMapper) Prepare ¶
func (m *SelectMapper) Prepare(data interface{}) *SelectMapper
Prepare using text/template
func (*SelectMapper) PrepareWithFunc ¶
func (m *SelectMapper) PrepareWithFunc(data interface{}, funcMap template.FuncMap) *SelectMapper
PrepareWithFunc using text/template with func
type TX ¶
type TX struct {
// contains filtered or unexported fields
}
TX struct
func (*TX) Update ¶
func (tx *TX) Update(m *UpdateMapper) error
type UpdateMapper ¶
type UpdateMapper struct {
// contains filtered or unexported fields
}
func (*UpdateMapper) AffectedRows ¶
func (m *UpdateMapper) AffectedRows() int64
AffectedRows get affectedRows
func (*UpdateMapper) Args ¶
func (m *UpdateMapper) Args(args ...interface{}) *UpdateMapper
Args set args
func (*UpdateMapper) InsertedId ¶
func (m *UpdateMapper) InsertedId() int64
InsertedId get insertedId
func (*UpdateMapper) Prepare ¶
func (m *UpdateMapper) Prepare(data interface{}) *UpdateMapper
Prepare using text/template
func (*UpdateMapper) PrepareWithFunc ¶
func (m *UpdateMapper) PrepareWithFunc(data interface{}, funcMap template.FuncMap) *UpdateMapper
PrepareWithFunc using text/template
Click to show internal directories.
Click to hide internal directories.