db

package
v0.0.0-...-84116e0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB is a wrapper around gorm

func New

func New(dialector gorm.Dialector) (*DB, error)

New returns a new database service

func NewPostgres

func NewPostgres(conn string) (*DB, error)

NewPostgres returns a new postgres database service from connection string

func (*DB) Close

func (d *DB) Close() error

Close closes connection to the DB

func (*DB) GetDB

func (d *DB) GetDB() *gorm.DB

GetDB returns a pointer to the DB

func (*DB) Migrate

func (d *DB) Migrate(tables ...interface{}) error

Migrate runs table migrations

Jump to

Keyboard shortcuts

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