database

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectionDatabase

func ConnectionDatabase(d Databaser) (*gorm.DB, error)

func DatabaseConnection

func DatabaseConnection() (*gorm.DB, error)

DatabaseConnection DB_USER= DB_PASS= DB_ADDRESS=database.***.location.rds.amazomaws.com DB_NAME= DB_PORT= db, err := DatabaseConnection()

if err != nil {
	c.JSON(500, appErrors.ErrMeatdataMsg(err, appErrors.ServerError))
	return
}
defer db.Close()

Types

type ConfigList

type ConfigList struct {
	DbDriverName   string
	DbName         string
	DbUserName     string
	DbUserPassword string
	DbHost         string
	DbPort         string
	ServerPort     string
}

------------------------------------------------------

func NewDB

func NewDB(file string) (*ConfigList, error)

func NewLocalDB

func NewLocalDB(user, pass, dbName string) (*ConfigList, error)

func (*ConfigList) Connect

func (c *ConfigList) Connect() (*gorm.DB, error)

func (*ConfigList) LocalDatabase

func (c *ConfigList) LocalDatabase() (*gorm.DB, error)

func (*ConfigList) NewMakeDB

func (c *ConfigList) NewMakeDB(tables ...interface{}) error

type Databaser

type Databaser interface {
	LocalDatabase() (*gorm.DB, error)
}

func NewData

func NewData() Databaser

Jump to

Keyboard shortcuts

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