database

package
v0.0.0-...-34c5bf1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Find(out interface{}, where ...interface{}) error
	Create(value interface{}) error
	Delete(value interface{}, where ...interface{}) error
}

Database is an interface for accessing the system's persistent data store

type Gorm

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

Gorm is a database accessor that uses a gorm DB instance

func NewGorm

func NewGorm(db *gorm.DB) *Gorm

NewGorm returns a new database using the specifed gorm instance

func (*Gorm) Create

func (g *Gorm) Create(value interface{}) error

Create adds a new record based on value

func (*Gorm) Delete

func (g *Gorm) Delete(value interface{}, where ...interface{}) error

Delete performs a hard-delete of matching rows

func (*Gorm) Find

func (g *Gorm) Find(out interface{}, where ...interface{}) error

Find marshals all matching records into out

Jump to

Keyboard shortcuts

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