Documentation ¶
Index ¶
- func CheckCEDBVersion(dc *DBConfig) error
- func CheckCEDBVersionTableExists(dc *DBConfig) (bool, error)
- func CheckDBVersion(dc *DBConfig, tableName string, expectedVersion string) error
- func CheckTableExists(dc *DBConfig, tableName string) (bool, error)
- func CreateCEDBVersionTable(dc *DBConfig) error
- func CreateDatabase(dc *DBConfig) error
- func CreateDatabaseIfNotExists(dc *DBConfig) (bool, error)
- func CreateTable(dc *DBConfig, sql string) error
- func DropDatabase(dc *DBConfig) error
- func DropDatabaseIfInitTablesFailed(dc *DBConfig, editionFunc EditionInitTablesFunc) error
- func ExecuteCEIssues(dc *DBConfig, curVersion string) error
- func ExecuteIssues(dc *DBConfig, curVersion string, schemaDir string) error
- func GetCEDBVersion(dc *DBConfig) (string, error)
- func GetDBVersion(dc *DBConfig, tableName string) (string, error)
- func GetSessionWithName(cfg config.MySqlConfig) (*gorm.DB, error)
- func GetSessionWithoutName(cfg config.MySqlConfig) (*gorm.DB, error)
- func InitCETables(dc *DBConfig) error
- func InitDefaultORGTables(dc *DBConfig, schemaDir string) error
- func InitORGTables(dc *DBConfig, schemaDir string) error
- func InitTables(dc *DBConfig, schemaDir string) error
- func InsertDBVersion(dc *DBConfig, tableName string, version string) error
- func LogDBName(databaseName string, format string, a ...any) string
- type DBConfig
- type Edition
- type EditionInitTablesFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCEDBVersion ¶
func CheckDBVersion ¶
func CreateCEDBVersionTable ¶
func CreateDatabase ¶
func CreateTable ¶
func DropDatabase ¶
func DropDatabaseIfInitTablesFailed ¶
func DropDatabaseIfInitTablesFailed(dc *DBConfig, editionFunc EditionInitTablesFunc) error
func ExecuteCEIssues ¶
func GetCEDBVersion ¶
func GetSessionWithName ¶
func GetSessionWithName(cfg config.MySqlConfig) (*gorm.DB, error)
func GetSessionWithoutName ¶
func GetSessionWithoutName(cfg config.MySqlConfig) (*gorm.DB, error)
func InitCETables ¶
func InitDefaultORGTables ¶
func InitORGTables ¶
func InitTables ¶
Types ¶
type DBConfig ¶
type DBConfig struct { DB *gorm.DB Config config.MySqlConfig }
func NewDBConfig ¶
func NewDBConfig(db *gorm.DB, cfg config.MySqlConfig) *DBConfig
func (*DBConfig) GetDatabaseName ¶
func (*DBConfig) SetConfig ¶
func (dc *DBConfig) SetConfig(c config.MySqlConfig)
type EditionInitTablesFunc ¶
Click to show internal directories.
Click to hide internal directories.