database

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(details *ConnectionDetails)

Configure bootstraps a Database Connection.

Types

type ConnectionDetails

type ConnectionDetails struct {
	User     string
	Name     string
	Password string
	Host     string
	Port     int
}

ConnectionDetails contains all the information about a Database Connection.

type Database

type Database struct {
	// contains filtered or unexported fields
}

Database is a wrapper for gorm.DB.

func NewDatabase

func NewDatabase() *Database

NewDatabase create a new Database wrapper.

func (*Database) Close

func (d *Database) Close()

Close is a wrapper to close the Database Connection.

func (*Database) Connection

func (d *Database) Connection() *gorm.DB

Connection creates a new database connection or if exists returns with the existing one.

func (*Database) Migrate

func (d *Database) Migrate()

Migrate is a wrapper to call AutoMigrate on a Database Connection.

Jump to

Keyboard shortcuts

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