store

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 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 DBClient

type DBClient struct {
	Conn    *sqlx.DB
	Queries goyesql.Queries
}

DBClient represents the structure to hold DB Client object required to create DB session and query and fetch results.

func (*DBClient) FetchResults

func (client *DBClient) FetchResults(query string) (map[string]interface{}, error)

FetchResults executes the query and parses the result

type DBConnOpts

type DBConnOpts struct {
	QueryFilePath string
}

DBConnOpts represents additonal parameters to create a DB Client

type Manager

type Manager interface {
	FetchResults(string) (map[string]interface{}, error)
}

Manager represents the set of methods used to interact with the db.

func NewDBClient

func NewDBClient(db string, dsn string, queryFile string) (Manager, error)

NewDBClient initializes a connection object with the databse.

func NewManager

func NewManager(db string, dsn string, opts *DBConnOpts) (Manager, error)

NewManager instantiates an object of Manager based on the params

Jump to

Keyboard shortcuts

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