Documentation
¶
Index ¶
- func DatabaseExists(dbPath string) (bool, error)
- func DatabaseWithDefaultSettings(path string, createDatabaseIfNotExists bool, log *logger.Logger) (*gorm.DB, error)
- type Engine
- func CheckDatabaseEngine(dbPath string, createDatabaseIfNotExists bool, dbEngine ...Engine) (Engine, error)
- func DatabaseEngineAllowed(dbEngine Engine, allowedEngines ...Engine) (Engine, error)
- func DatabaseEngineFromString(engineStr string) (Engine, error)
- func DatabaseEngineFromStringAllowed(dbEngineStr string, allowedEngines ...Engine) (Engine, error)
- func LoadDatabaseEngineFromFile(path string) (Engine, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseExists ¶
DatabaseExists checks if the database folder exists and is not empty.
Types ¶
type Engine ¶
type Engine string
func CheckDatabaseEngine ¶
func CheckDatabaseEngine(dbPath string, createDatabaseIfNotExists bool, dbEngine ...Engine) (Engine, error)
CheckDatabaseEngine checks if the correct database engine is used. This function stores a so called "database info file" in the database folder or checks if an existing "database info file" contains the correct engine. Otherwise the files in the database folder are not compatible.
func DatabaseEngineAllowed ¶
DatabaseEngineAllowed checks if the database engine is allowed.
func DatabaseEngineFromString ¶
DatabaseEngineFromString parses an engine from a string. Returns an error if the engine is unknown.
func DatabaseEngineFromStringAllowed ¶
DatabaseEngineFromStringAllowed parses an engine from a string and checks if the database engine is allowed.
func LoadDatabaseEngineFromFile ¶
LoadDatabaseEngineFromFile returns the engine from the "database info file".