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 CreateDatabase(dc *DBConfig) error
- func CreateDatabaseIfNotExists(dc *DBConfig) (bool, 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, rawSqlDir string) error
- func GetCEDBVersion(dc *DBConfig) (string, error)
- func GetDBVersion(dc *DBConfig, tableName string) (string, error)
- func GetDBVersionDDLFile(rawSqlDir string) string
- func GetSortedSQLFiles(parentDir string, defaultDB bool) []string
- func InitCETables(dc *DBConfig) error
- func InitDBVersionTable(dc *DBConfig, rawSqlDir string) error
- func InitTables(dc *DBConfig, rawSqlDir string) error
- func InsertDBVersion(dc *DBConfig, tableName string, version string) error
- func LogDBName(databaseName string, format string, a ...any) string
- func ReadAndExecuteSqlFile(dc *DBConfig, sqlFile string) error
- type DBConfig
- type EditionInitTablesFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCEDBVersion ¶
func CheckDBVersion ¶
func CreateDatabase ¶
func DropDatabase ¶
func DropDatabaseIfInitTablesFailed ¶
func DropDatabaseIfInitTablesFailed(dc *DBConfig, editionFunc EditionInitTablesFunc) error
func ExecuteCEIssues ¶
func GetCEDBVersion ¶
func GetDBVersionDDLFile ¶
GetDBVersionDDLFile returns the *_db_version.sql file path in the rawSqlDir.
func GetSortedSQLFiles ¶
AI code GetSortedSQLFiles returns the .sql files in the target directory sorted by these rules: 1. Files starting with ddl_ come before files starting with dml_. 2. Within ddl_ files: those containing create_table run first, those containing create_trigger run last, any other ddl_* files are in between. 3. If defaultDB is true, only files starting with default_db_ are considered; that prefix is stripped for applying the same sorting rules.
func InitCETables ¶
func InitDBVersionTable ¶
func InitTables ¶
func ReadAndExecuteSqlFile ¶
Types ¶
type DBConfig ¶
func (*DBConfig) GetDatabaseName ¶
type EditionInitTablesFunc ¶
Click to show internal directories.
Click to hide internal directories.