postgresql

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Log api.LogService
	Env api.Settings
	// contains filtered or unexported fields
}

Service to help abstract the technical implementation per driver used.

func (*Service) Array

func (service *Service) Array(model interface{}, expr string, retval interface{}, condition string, params ...interface{})

Array fills an array from the model and expression.

func (*Service) CheckTable

func (service *Service) CheckTable(entity interface{}) error

CheckTable ensures a the table exists for the persistor.

func (*Service) ColumnsWhere

func (service *Service) ColumnsWhere(model interface{}, columns []string, condition string, params ...interface{}) error

ColumnsWhere is a conditional selection based on the model in the data store only returning specific quoted columns.

func (*Service) Configure

func (service *Service) Configure()

Configure establishes a new database connection

func (*Service) Count

func (service *Service) Count(model interface{}, condition string, params ...interface{}) int

Count return the number of rows found.

func (*Service) CountExpr

func (service *Service) CountExpr(model interface{}, expr string, retval interface{}, condition string, params ...interface{})

CountExpr return the number of rows found with an expression.

func (*Service) Delete

func (service *Service) Delete(query interface{}) error

Delete removes the model from the data store

func (*Service) Find

func (service *Service) Find(query interface{}, callback func(query interface{}))

Find will check if the model exists and run the additional functionality.

func (*Service) FindAll

func (service *Service) FindAll(query interface{}) error

FindAll instances of a type of model.

func (*Service) Insert

func (service *Service) Insert(query ...interface{}) error

Insert persists the new model in the data store

func (*Service) Raw

func (service *Service) Raw(query interface{}, params ...interface{}) error

Raw executes a string of SQL.

func (*Service) Save

func (service *Service) Save(query ...interface{}) error

Save persists the model in the data store

func (*Service) Select

func (service *Service) Select(query interface{}) error

Select returns the model from the data store

func (*Service) Update

func (service *Service) Update(query interface{}) error

Update persists the existing model in the data store

func (*Service) Where

func (service *Service) Where(model interface{}, condition string, params ...interface{}) error

Where is a conditional selection based on the model in the data store.

Jump to

Keyboard shortcuts

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