Documentation
¶
Overview ¶
包mysql实现了gdb.Driver,它支持MySQL数据库的操作。 md5:87c26760917d504d
Index ¶
- func New() gdb.Driver
- type Driver
- func (d *Driver) New(core *gdb.X结构_Core, node *gdb.X结构_配置) (gdb.DB, error)
- func (d *Driver) X取表名称数组(ctx context.Context, schema ...string) (tables []string, err error)
- func (d *Driver) X取表字段信息Map(ctx context.Context, table string, schema ...string) (fields map[string]*gdb.X结构_TableField, err error)
- func (d *Driver) X底层DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)
- func (d *Driver) X底层Open(config *gdb.X结构_配置) (db *sql.DB, err error)
- func (d *Driver) X底层取数据库安全字符() (charLeft string, charRight string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
Driver 是用于 MySQL 数据库的驱动程序。 md5:db674980450242e3
func (*Driver) New ¶
New 创建并返回一个针对 MySQL 的数据库对象。它实现了 gdb.Driver 接口,以便于额外的数据库驱动程序安装。 md5:e61df629828efeff
func (*Driver) X取表字段信息Map ¶
func (d *Driver) X取表字段信息Map(ctx context.Context, table string, schema ...string) (fields map[string]*gdb.X结构_TableField, err error)
X取表字段信息Map 获取并返回当前模式指定表的字段信息。
参数 `link` 是可选的,如果为 nil,则自动获取一个原始 SQL 连接,用于执行必要的 SQL 查询。
它返回一个包含字段名及其对应字段的映射。由于映射是无序的,TableField 结构体有一个 "Index" 字段,标记其在字段中的顺序。
该方法使用缓存功能来提高性能,直到进程重启,缓存永不过期。 md5:38bed6cd2a065572
func (*Driver) X底层DoFilter ¶
func (d *Driver) X底层DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)
X底层DoFilter 在将SQL提交到数据库之前进行处理。 md5:e56455a7432db765
func (*Driver) X底层Open ¶
X底层Open 创建并返回一个底层的 sql.DB 对象,用于 MySQL。 注意,它将时间.Time 参数默认转换为本地时区。 md5:341df118003c304e
func (*Driver) X底层取数据库安全字符 ¶
X底层取数据库安全字符 返回这种类型的数据库的安全字符。 md5:8a01432c4ed14729
Click to show internal directories.
Click to hide internal directories.