db

package
v0.0.0-...-3d067a8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownDialect = errors.New("Unknown database dialect")
)

Functions

This section is empty.

Types

type Database

type Database interface {
	Close() error

	Create(value interface{}) error

	CreateTx(value interface{}) error

	Delete(value interface{}, query interface{}, args ...interface{}) error

	DeleteTx(value interface{}, query interface{},
		args ...interface{}) error

	EnableLogging(enable bool)

	Migrate(dir string) error

	Open(path string) error

	Read(out interface{}, query interface{}, args ...interface{}) error

	ReadAll(out interface{}) error

	Save(value interface{}) error

	SaveTx(value interface{}) error

	SetLogger(log Logger)

	SetMaxOpenConnections(max int)

	Tx(fn TxFn) (err error)

	Update(value interface{}, query interface{}, args ...interface{}) error

	UpdateTx(value interface{}, query interface{},
		args ...interface{}) error
}

func New

func New(dialect string) Database

type DialectFn

type DialectFn func(dsn string) gorm.Dialector

type Logger

type Logger logger.Writer

type TxFn

type TxFn func(tx *gorm.DB) error

Jump to

Keyboard shortcuts

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