beedb: Index | Files | Directories

package beedb

import ""


Package Files

beedb.go util.go


var OnDebug = false
var PluralizeTableNames = false

func StructName Uses

func StructName(s interface{}) string

type Model Uses

type Model struct {
    Db              *sql.DB
    TableName       string
    LimitStr        int
    OffsetStr       int
    WhereStr        string
    ParamStr        []interface{}
    OrderStr        string
    ColumnStr       string
    PrimaryKey      string
    JoinStr         string
    GroupByStr      string
    HavingStr       string
    QuoteIdentifier string
    ParamIdentifier string
    ParamIteration  int

func New Uses

func New(db *sql.DB, options ...interface{}) (m Model)


* Add New sql.DB in the future i will add ConnectionPool.Get()

func (*Model) Delete Uses

func (orm *Model) Delete(output interface{}) (int64, error)

func (*Model) DeleteAll Uses

func (orm *Model) DeleteAll(rowsSlicePtr interface{}) (int64, error)

func (*Model) DeleteRow Uses

func (orm *Model) DeleteRow() (int64, error)

func (*Model) Exec Uses

func (orm *Model) Exec(finalQueryString string, args ...interface{}) (sql.Result, error)

Execute sql

func (*Model) Find Uses

func (orm *Model) Find(output interface{}) error

func (*Model) FindAll Uses

func (orm *Model) FindAll(rowsSlicePtr interface{}) error

func (*Model) FindMap Uses

func (orm *Model) FindMap() (resultsSlice []map[string][]byte, err error)

func (*Model) GroupBy Uses

func (orm *Model) GroupBy(keys string) *Model

func (*Model) Having Uses

func (orm *Model) Having(conditions string) *Model

func (*Model) InitModel Uses

func (orm *Model) InitModel()

func (*Model) Insert Uses

func (orm *Model) Insert(properties map[string]interface{}) (int64, error)

inert one info

func (*Model) InsertBatch Uses

func (orm *Model) InsertBatch(rows []map[string]interface{}) ([]int64, error)

insert batch info

func (*Model) Join Uses

func (orm *Model) Join(join_operator, tablename, condition string) *Model

The join_operator should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN

func (*Model) Limit Uses

func (orm *Model) Limit(start int, size *Model

func (*Model) Offset Uses

func (orm *Model) Offset(offset int) *Model

func (*Model) OrderBy Uses

func (orm *Model) OrderBy(order string) *Model

func (*Model) Save Uses

func (orm *Model) Save(output interface{}) error

if the struct has PrimaryKey == 0 insert else update

func (*Model) ScanPK Uses

func (orm *Model) ScanPK(output interface{}) *Model

func (*Model) Select Uses

func (orm *Model) Select(colums string) *Model

func (*Model) SetPK Uses

func (orm *Model) SetPK(pk string) *Model

func (*Model) SetTable Uses

func (orm *Model) SetTable(tbname string) *Model

func (*Model) Update Uses

func (orm *Model) Update(properties map[string]interface{}) (int64, error)

update info

func (*Model) Where Uses

func (orm *Model) Where(querystring interface{}, args ...interface{}) *Model



Package beedb imports 7 packages (graph) and is imported by 86 packages. Updated 2016-07-26. Refresh now. Tools for package owners.