Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *gorm.DB
DB holds the connection to the database.
Functions ¶
func ConnectToDb ¶
func ConnectToDb()
ConnectToDb initializes a connection to the database. It uses the value of the "DB" environment variable to determine the database connection string. If the connection fails, it panics.
func LoadEnvVariables ¶
func LoadEnvVariables()
LoadEnvVariables loads environment variables from a .env file. It uses the godotenv package to load the variables. If loading fails, it logs a fatal error.
func SyncDatabase ¶
func SyncDatabase()
SyncDatabase performs automatic migration of database tables. It ensures that the database schema matches the structure of the defined models.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.