postgres

package
v0.0.0-...-77bdb4f Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

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

Postgres driver

func New

func New(host string, port uint64, database, username, password string) (db *Postgres, err error)

New creates Postgres driver

func (*Postgres) Close

func (db *Postgres) Close() (err error)

Close flushes data and closes files

func (*Postgres) GetByID

func (db *Postgres) GetByID(table string, ID interface{}) (*sql.Row, error)

GetByID implements interface for getting table row by ID

func (*Postgres) GetLimited

func (db *Postgres) GetLimited(table string, limit uint64) (*sql.Rows, error)

GetLimited implements interface for getting last limited table rows by ID

func (*Postgres) GetLimitedAfterID

func (db *Postgres) GetLimitedAfterID(table string, after, limit uint64) (*sql.Rows, error)

GetLimitedAfterID implements interface for getting limited table rows after specified ID

func (*Postgres) GetLimitedBeforeID

func (db *Postgres) GetLimitedBeforeID(table string, before, limit uint64) (*sql.Rows, error)

GetLimitedBeforeID implements interface for getting limited table rows before specified ID

func (*Postgres) Insert

func (db *Postgres) Insert(table string, columns []string, values []interface{}) (last uint64, err error)

Insert implements interface for inserting table rows

func (*Postgres) LastID

func (db *Postgres) LastID(table string) (id uint64, err error)

LastID implements interface for getting last ID in database table

func (*Postgres) Update

func (db *Postgres) Update(table string, columns []string, values []interface{}) (count uint64, err error)

Update implements interface for updating table rows

Jump to

Keyboard shortcuts

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