Documentation ¶
Index ¶
- Variables
- func QueryHasRows(query *sql.Rows) bool
- func ScanStream(qb QueryBuilder, s Scannable, f func(Scannable))
- type Database
- type DbProxy
- func (db *DbProxy) Build() QueryBuilder
- func (db *DbProxy) Close() error
- func (db *DbProxy) CreateTable(name string, pk []string, columns [][]string)
- func (db *DbProxy) DB() *sql.DB
- func (db *DbProxy) DoesTableExist(table string) bool
- func (db *DbProxy) DriverName() string
- func (db *DbProxy) DropTable(name string)
- func (db *DbProxy) IntPrimaryKey() string
- func (db *DbProxy) Ping() error
- func (db *DbProxy) QueryColumnList(table string) []string
- func (db *DbProxy) QueryNextID(table string) int64
- func (db *DbProxy) QueryPrepared(modify bool, q string, args ...interface{}) *sql.Rows
- func (db *DbProxy) QueryRowCount(table string) int64
- func (db *DbProxy) QueryTableInfo(table string) []PragmaTableInfo
- func (db *DbProxy) TagName() string
- func (db *DbProxy) TypeForType(t reflect.Type) string
- type Executable
- type Inner
- type Outer
- type PragmaTableInfo
- type QueryBuilder
- type Scannable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( StatementDebug bool DebugVerbose bool )
flag vars
View Source
var ( // InsertsLock - use this so that Database.QueryNextID and DataBase.Build.Ins happen in an atomic fashion. InsertsLock = new(sync.Mutex) )
Functions ¶
func QueryHasRows ¶
QueryHasRows checks if a Rows response contains any values, and then closes the query.
func ScanStream ¶
func ScanStream(qb QueryBuilder, s Scannable, f func(Scannable))
Types ¶
type DbProxy ¶
type DbProxy struct {
// contains filtered or unexported fields
}
func (*DbProxy) Build ¶
func (db *DbProxy) Build() QueryBuilder
func (*DbProxy) CreateTable ¶
func (*DbProxy) DoesTableExist ¶
func (*DbProxy) DriverName ¶
func (*DbProxy) IntPrimaryKey ¶
func (*DbProxy) QueryColumnList ¶
func (*DbProxy) QueryNextID ¶
func (*DbProxy) QueryPrepared ¶
func (*DbProxy) QueryRowCount ¶
func (*DbProxy) QueryTableInfo ¶
func (db *DbProxy) QueryTableInfo(table string) []PragmaTableInfo
type Executable ¶
Executable is any object who represents a query that can be called on to produce a sql.Rows
type Inner ¶
type Inner interface { Ping() error Close() error DB() *sql.DB CreateTable(name string, pk []string, columns [][]string) DoesTableExist(table string) bool Build() QueryBuilder QueryColumnList(table string) []string QueryNextID(table string) int64 QueryRowCount(table string) int64 DropTable(name string) DriverName() string TagName() string IntPrimaryKey() string TypeForType(reflect.Type) string }
type PragmaTableInfo ¶
type QueryBuilder ¶
type QueryBuilder interface { Se(cols string) QueryBuilder Fr(tabls string) QueryBuilder WR(col string, op string, value string, raw bool, ags ...interface{}) QueryBuilder Wr(col string, op string, value string) QueryBuilder Wh(col string, value string) QueryBuilder Or(col string, order string) QueryBuilder Lm(limit int64) QueryBuilder Of(offset int64) QueryBuilder Up(table string, col string, value string) QueryBuilder Ins(table string, values ...interface{}) Executable InsI(table string, strct interface{}) Executable Del(table string) QueryBuilder Executable }
type Scannable ¶
Scannable can take in Rows and return an object
func ScanAll ¶
func ScanAll(qb QueryBuilder, s Scannable) []Scannable
ScanAll scans all possible values of a QueryBuilder into an array based on template Scannable.
func ScanFirst ¶
func ScanFirst(qb QueryBuilder, s Scannable) Scannable
ScanFirst scans the first value from the QueryBuilder, then closes the query.
Click to show internal directories.
Click to hide internal directories.