Documentation ¶
Index ¶
- Variables
- type ColumnMap
- type DbMap
- type SQLExecutor
- type SQLQuery
- func (this *SQLQuery) GetAll(slices interface{}, exec SQLExecutor, args ...interface{}) (int64, error)
- func (this *SQLQuery) GetOne(holder interface{}, exec SQLExecutor, args ...interface{}) (err error)
- func (this *SQLQuery) GetPage(slices interface{}, pageNo int, args ...interface{}) (rows int64, err error)
- func (this *SQLQuery) GetPageBar(pattern string, elements map[string]string, f func(page int) string) (h string)
- func (this *SQLQuery) InitPage(args ...interface{})
- func (this *SQLQuery) InitPage1(where string, args ...interface{})
- func (this *SQLQuery) InitPage2(fields, where string, args ...interface{})
- func (this *SQLQuery) MakeSQL(pageMode bool, suffixes ...string) (s string)
- func (this *SQLQuery) SetAs(args ...string) *SQLQuery
- func (this *SQLQuery) SetFields(s string) *SQLQuery
- func (this *SQLQuery) SetGroupBy(s string) *SQLQuery
- func (this *SQLQuery) SetHaving(s string) *SQLQuery
- func (this *SQLQuery) SetJoin(s string) *SQLQuery
- func (this *SQLQuery) SetLimit(s string) *SQLQuery
- func (this *SQLQuery) SetOrderBy(s string) *SQLQuery
- func (this *SQLQuery) SetPageMode(maxNavPage, rowsPerPage int)
- func (this *SQLQuery) SetSuffixes(suffixes ...string) *SQLQuery
- func (this *SQLQuery) SetWhere(s string) *SQLQuery
- type StmtBind
- type TableMap
- type Transaction
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSelectOneGetMore = errors.New("SelectOne: got multiple rows")
)
View Source
var HTML_Paging = `` /* 140-byte string literal not displayed */
View Source
var HTML_Paging_Elements = map[string]string{
"FIRST": "[page] : href='[href]'",
"PREVN": "[page] : href='[href]'",
"PREV": "[page] : href='[href]'",
"NEXT": "[page] : href='[href]'",
"NEXTN": "[page] : href='[href]'",
"LAST": "[page] : href='[href]'",
"INFO": "[page]/[count]",
"SELECT": "\t[page]# href='[href]'\n",
"AROUND": "\thref='[href]', [page]\n",
}
Functions ¶
This section is empty.
Types ¶
type DbMap ¶
type DbMap interface { SQLExecutor Begin() (Transaction, error) // GetTableByName(t string) (TableMap, bool) GetTableByMeta(meta interface{}) (TableMap, bool) AddTable(meta interface{}, name string) (TableMap, error) AddTable2(meta interface{}, name, comment string) (TableMap, error) AddTable3(meta interface{}, schema, name, comment string) (TableMap, error) CreateTables(ifNotExists bool, args ...interface{}) (sql string, err error) TruncateTables(args ...interface{}) (sql string, err error) DropTables(ifExists bool, args ...interface{}) (sql string, err error) DropTableByName(t string, ifExists bool) error DropTableByMeta(meta interface{}, ifExists bool) error }
type SQLExecutor ¶
type SQLExecutor interface { dialect.Execer dialect.Queryer // Insert(objects ...interface{}) (int64, error) Update(objects ...interface{}) (int64, error) Delete(objects ...interface{}) (int64, error) Get(objects ...interface{}) (int64, error) // SelectBool(query string, args ...interface{}) (bool, error) SelectNullBool(query string, args ...interface{}) (sql.NullBool, error) SelectInt(query string, args ...interface{}) (int64, error) SelectNullInt(query string, args ...interface{}) (sql.NullInt64, error) SelectFloat(query string, args ...interface{}) (float64, error) SelectNullFloat(query string, args ...interface{}) (sql.NullFloat64, error) SelectStr(query string, args ...interface{}) (string, error) SelectNullStr(query string, args ...interface{}) (sql.NullString, error) // SelectVal(holder interface{}, query string, args ...interface{}) error SelectOne(holder interface{}, query string, args ...interface{}) error SelectAll(slices interface{}, query string, args ...interface{}) (int64, error) }
type SQLQuery ¶
type SQLQuery struct {
// contains filtered or unexported fields
}
func NewSQLQuery ¶
func (*SQLQuery) GetAll ¶
func (this *SQLQuery) GetAll(slices interface{}, exec SQLExecutor, args ...interface{}) (int64, error)
func (*SQLQuery) GetOne ¶
func (this *SQLQuery) GetOne(holder interface{}, exec SQLExecutor, args ...interface{}) (err error)
func (*SQLQuery) GetPageBar ¶
func (*SQLQuery) SetGroupBy ¶
func (*SQLQuery) SetOrderBy ¶
func (*SQLQuery) SetPageMode ¶
func (*SQLQuery) SetSuffixes ¶
type StmtBind ¶
type StmtBind interface { Close() error Exec(args ...interface{}) (sql.Result, error) Query(args ...interface{}) error Next() error One() error }
func NewStmtBind ¶
type TableMap ¶
type TableMap interface { SQLExecutor // CreateSQL(ifNotExists bool) string Create(ifNotExists bool) error DropSQL(ifExists bool) string Drop(ifExists bool) error TruncateSQL() string Truncate() error // Insert2(exec SQLExecutor, data map[string]string, except []string) (id int64, err error) Update2(exec SQLExecutor, where string, data map[string]string, except []string) (rows int64, err error) Delete2(exec SQLExecutor, where string) (rows int64, err error) SelectVal2(holder interface{}, where string, args ...interface{}) error SelectOne2(holder interface{}, where string, args ...interface{}) error SelectAll2(slices interface{}, where string, args ...interface{}) (int64, error) SelectVal2x(holder interface{}, where, suffix string, args ...interface{}) error SelectOne2x(holder interface{}, where, suffix string, args ...interface{}) error SelectAll2x(slices interface{}, where, suffix string, args ...interface{}) (int64, error) SelectVal3(holder interface{}, fields, where string, args ...interface{}) error SelectOne3(holder interface{}, fields, where string, args ...interface{}) error SelectAll3(slices interface{}, fields, where string, args ...interface{}) (int64, error) SelectVal3x(holder interface{}, fields, where, suffix string, args ...interface{}) error SelectOne3x(holder interface{}, fields, where, suffix string, args ...interface{}) error SelectAll3x(slices interface{}, fields, where, suffix string, args ...interface{}) (int64, error) // contains filtered or unexported methods }
type Transaction ¶
type Transaction interface { SQLExecutor // Commit() error Rollback() error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.