mysql

package
v0.0.0-...-782a3f7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT, MIT Imports: 12 Imported by: 0

Documentation

Overview

包mysql实现了gdb.Driver,它支持MySQL数据库的操作。 md5:87c26760917d504d

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() gdb.Driver

New 创建并返回一个实现了gdb.Driver接口的驱动器,该驱动器支持对MySQL的操作。 md5:95ca0306bee3a521

Types

type Driver

type Driver struct {
	*gdb.X结构_Core
}

Driver 是用于 MySQL 数据库的驱动程序。 md5:db674980450242e3

func (*Driver) New

func (d *Driver) New(core *gdb.X结构_Core, node *gdb.X结构_配置) (gdb.DB, error)

New 创建并返回一个针对 MySQL 的数据库对象。它实现了 gdb.Driver 接口,以便于额外的数据库驱动程序安装。 md5:e61df629828efeff

func (*Driver) X取表名称数组

func (d *Driver) X取表名称数组(ctx context.Context, schema ...string) (tables []string, err error)

X取表名称数组 获取并返回当前模式下的表格列表。 主要用于命令行工具链,用于自动生成模型。 md5:bce161ba95454bf5

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

func (d *Driver) X底层Open(config *gdb.X结构_配置) (db *sql.DB, err error)

X底层Open 创建并返回一个底层的 sql.DB 对象,用于 MySQL。 注意,它将时间.Time 参数默认转换为本地时区。 md5:341df118003c304e

func (*Driver) X底层取数据库安全字符

func (d *Driver) X底层取数据库安全字符() (charLeft string, charRight string)

X底层取数据库安全字符 返回这种类型的数据库的安全字符。 md5:8a01432c4ed14729

Jump to

Keyboard shortcuts

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