Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrationsHandler ¶ added in v1.1.0
type MigrationsHandler struct { BeforeHandler func() error // 迁移之前处理函数 AfterHandler func() error // 迁移之后处理函数 }
迁移处理函数
type MySQLMakeMigrations ¶ added in v1.0.12
type MySQLMakeMigrations struct { DATABASES []string MODELS []MySQLModel }
MySQL 创建迁移
type MySQLSettings ¶ added in v1.0.12
type MySQLSettings struct { MigrationsHandler // 迁移处理函数 TABLE_NAME string // 设置表名 ENGINE string // 设置存储引擎,默认: InnoDB AUTO_INCREMENT int // 设置自增长起始值 DEFAULT_CHARSET string // 设置默认字符集,如: utf8mb4 COLLATE string // 设置校对规则,如 utf8mb4_0900_ai_ci; MIN_ROWS int // 设置最小行数 MAX_ROWS int // 设置最大行数 CHECKSUM int // 表格的校验和算法,如 1 开启校验和 DELAY_KEY_WRITE int // 控制非唯一索引的写延迟,如 1 ROW_FORMAT string // 设置行的存储格式,如 DYNAMIC, COMPACT, FULL. DATA_DIRECTORY string // 设置数据存储目录 INDEX_DIRECTORY string // 设置索引存储目录 PARTITION_BY string // 定义分区方式,如 RANGE、HASH、LIST COMMENT string // 设置表注释 // 自定义配置 MySettings MySettings }
MySQL 模型设置
func (MySQLSettings) Get ¶ added in v1.0.12
func (mysqlmodelsettings MySQLSettings) Get(name string) interface{}
获取自定义配置
func (*MySQLSettings) Set ¶ added in v1.0.12
func (mysqlmodelsettings *MySQLSettings) Set(name string, value interface{})
设置自定义配置
type SQLite3MakeMigrations ¶ added in v1.0.12
type SQLite3MakeMigrations struct { DATABASES []string MODELS []SQLite3Model }
SQLite3 创建迁移
type SQLite3Model ¶ added in v1.0.12
type SQLite3Model interface {
ModelSet() *SQLite3Settings
}
模型类
type SQLite3Settings ¶ added in v1.0.12
type SQLite3Settings struct { MigrationsHandler // 迁移处理函数 TABLE_NAME string // 表名 // 自定义配置 MySettings MySettings }
SQLite3 模型设置
func (SQLite3Settings) Get ¶ added in v1.0.12
func (modelsettings SQLite3Settings) Get(name string) interface{}
获取自定义配置
func (*SQLite3Settings) Set ¶ added in v1.0.12
func (modelsettings *SQLite3Settings) Set(name string, value interface{})
设置自定义配置
Click to show internal directories.
Click to hide internal directories.