Documentation ¶
Index ¶
- func Conn() *sqlx.DB
- func Connect(gtx context.Context, url *url.URL, timeZone string) (*sqlx.DB, error)
- func ConnectWithOpts(gtx context.Context, opts *ConnOpts) (*sqlx.DB, error)
- func GetFilterValues(gtx context.Context, dtype string, specs []*data.FilterSpec, ...) (*data.FilterValues, error)
- func InsertQuery(table string, fields ...string) string
- func NamedConn(name string) *sqlx.DB
- func NewGetterDeleter() data.GetterDeleter
- func PrintDbTime()
- func RequirePostgres(ctx *cli.Context) error
- func Rollback(op string, tx *sqlx.Tx)
- func SetDefaultConn(db *sqlx.DB)
- func SetNamedConn(name string, db *sqlx.DB)
- func Wrap(cmd *cli.Command) *cli.Command
- type ConnOpts
- type Selector
- type SelectorGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectWithOpts ¶
ConnectWithOpts - connect to postgresdb based on given options
func GetFilterValues ¶
func GetFilterValues( gtx context.Context, dtype string, specs []*data.FilterSpec, filter *data.Filter) (*data.FilterValues, error)
func InsertQuery ¶
InsertQuery - creates a basic insert/create query from table name and fields. This query should only be used with named exec i.e with name parameters. The field names are also used to name the parameters
func NamedConn ¶
NamedConn - gives connection to database associated with given name. If no connection exists with given name nil is returned. If name is empty default connection is returned
func NewGetterDeleter ¶
func NewGetterDeleter() data.GetterDeleter
func PrintDbTime ¶
func PrintDbTime()
func RequirePostgres ¶
func RequirePostgres(ctx *cli.Context) error
func SetDefaultConn ¶
SetDefaultConn - sets the default postgres connection
func SetNamedConn ¶
SetNamedConn - register a postgres connection against name
Types ¶
type ConnOpts ¶
type ConnOpts struct { Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` DBName string `json:"dbName"` TimeZone string `json:"timeZone"` }
ConnOpts - postgres connection options
type SelectorGenerator ¶
type SelectorGenerator struct {
// contains filtered or unexported fields
}
func NewSelectorGenerator ¶
func NewSelectorGenerator() *SelectorGenerator
func (*SelectorGenerator) Reset ¶
func (gen *SelectorGenerator) Reset() *SelectorGenerator
func (*SelectorGenerator) Selector ¶
func (gen *SelectorGenerator) Selector(filter *data.Filter) Selector
func (*SelectorGenerator) SelectorX ¶
func (gen *SelectorGenerator) SelectorX(cmnParam *data.CommonParams) Selector
Click to show internal directories.
Click to hide internal directories.