Documentation ¶
Index ¶
- Variables
- func GetColumnName() string
- func GetTenant(ctx context.Context) string
- func Init(ctx context.Context) gdb.DB
- func SetFlag(ctx context.Context) context.Context
- func SetHandle(i Handle)
- func SetTenant(ctx context.Context, id string) context.Context
- type Config
- type Handle
- type Model
- type MysqlDriver
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FlagKey = "TenantFlag" ModeNone = "none" //关闭 ModeColumn = "column" //列模式 ModeDB = "db" //数据源模式 )
Functions ¶
func GetColumnName ¶
func GetColumnName() string
Types ¶
type MysqlDriver ¶
type MysqlDriver struct {
*mysql.Driver
}
func (*MysqlDriver) DoFilter ¶
func (d *MysqlDriver) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)
DoFilter is a hook function, which filters the sql and its arguments before it's committed to underlying driver. The parameter `link` specifies the current database connection operation object. You can modify the sql string `sql` and its arguments `args` as you wish before they're committed to driver.
func (*MysqlDriver) New ¶
func (d *MysqlDriver) New(core *gdb.Core, node *gdb.ConfigNode) (gdb.DB, error)
New creates and returns a database object for mysql. It implements the interface of gdb.Driver for extra database driver installation.
Directories ¶
Path | Synopsis |
---|---|
internal/dao/internal
========================================================================== Code generated by GoFrame CLI tool.
|
========================================================================== Code generated by GoFrame CLI tool. |
Click to show internal directories.
Click to hide internal directories.