Documentation
¶
Overview ¶
Package sql provides tools and DAOs for speaking SQL as well as managing tables migrations
Index ¶
- Variables
- func GetQueryValueFor(field string, values ...string) string
- func JoinWheresWithParenthesis(wheres []string, join string) string
- func NewDAOQuery(enquirer Enquirer, converters ...common.Converter) fmt.Stringer
- type BatchReceiver
- type BatchSender
- type DAO
- type Enquirer
- type Handler
- type PackrBox
- type PackrMigrationSource
- type Scanner
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoRows = sql.ErrNoRows
)
Functions ¶
func GetQueryValueFor ¶
GetQueryValueFor field value
func JoinWheresWithParenthesis ¶
JoinConditionsWithParenthesis joins conditions using parenthesis if there are many, or no parenthesis if there is just one, and prepend the WHERE keyword to the string
Types ¶
type BatchSender ¶
type BatchSender interface {
Send(interface{})
Close() error
}
BatchSender interface
type DAO ¶
type DAO interface {
dao.DAO
DB() *sql.DB
Prepare(string, interface{}) error
GetStmt(string, ...interface{}) *sql.Stmt
UseExclusion()
Lock()
Unlock()
}
DAO interface definition
type Enquirer ¶
type Enquirer interface {
GetSubQueries() []*any.Any
GetOperation() service.OperationType
GetOffset() int64
GetLimit() int64
GetGroupBy() int32
GetResourcePolicyQuery() *service.ResourcePolicyQuery
fmt.Stringer
}
Enquirer interface
type Handler ¶
Handler for the main functions of the DAO
func (*Handler) UseExclusion ¶
func (h *Handler) UseExclusion()
type PackrBox ¶
Avoids pulling in the packr library for everyone, mimicks the bits of packr.Box that we need.
type PackrMigrationSource ¶
type PackrMigrationSource struct {
Box PackrBox
// Path in the box to use.
Dir string
TablePrefix string
}
Migrations from a packr box.
func (PackrMigrationSource) FindMigrations ¶
func (p PackrMigrationSource) FindMigrations() ([]*migrate.Migration, error)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package index provides ready-to-use tables and DAOs for storing hierarchical data using the nested sets pattern * Copyright (c) 2018.
|
Package index provides ready-to-use tables and DAOs for storing hierarchical data using the nested sets pattern * Copyright (c) 2018. |
|
Package resources provides ready-to-use SQL schemes and DAOs for attaching resource policies to any data
|
Package resources provides ready-to-use SQL schemes and DAOs for attaching resource policies to any data |
Click to show internal directories.
Click to hide internal directories.