pg

package
v0.0.0-...-0ac9ed0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 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 Config

type Config struct {
	Dialect       string
	DSN           string
	IsLogMode     bool
	IsAutoMigrate bool
}

Config for a DB connection

type DB

type DB struct {
	D *gorm.DB
	// contains filtered or unexported fields
}

DB is the struct for a DB connection

func New

func New(conf Config, logger log.ILogger) (*DB, error)

New creates a new DB connection

func (*DB) DB

func (db *DB) DB() *gorm.DB

func (*DB) IsAutoMigrate

func (db *DB) IsAutoMigrate() bool

type IDB

type IDB interface {
	DB() *gorm.DB
	IsAutoMigrate() bool
}

IDB is the interface for a DB connection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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