initializers

package
v0.0.0-...-6119ed1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL