Documentation ¶
Index ¶
- func Make(cmd string, name string) (msg string, err error)
- func Migrate(cmd string) (msg string, err error)
- type DB
- func (db *DB) Delete(Model interface{}) (int64, error)
- func (db *DB) Error(err error)
- func (db *DB) ErrorMessages() error
- func (db *DB) Exists(Model interface{}) (exists bool, err error)
- func (db *DB) First(Model interface{}) error
- func (db *DB) Get(Model interface{}) ([]interface{}, error)
- func (db *DB) GroupBy(columns ...string) *DB
- func (db *DB) HasErrors() bool
- func (db *DB) Insert(Model interface{}) (interface{}, error)
- func (db *DB) Join(models ...interface{}) *DB
- func (db *DB) Limit(limit int) *DB
- func (db *DB) New(Model interface{}) (interface{}, error)
- func (db *DB) Offset(offset int) *DB
- func (db *DB) OrderBy(column string, order string) *DB
- func (db *DB) ResetQuery()
- func (db *DB) Return(resp interface{}, err error) (interface{}, error)
- func (db *DB) ReturnBool(resp bool, err error) (bool, error)
- func (db *DB) ReturnError(err error) error
- func (db *DB) ReturnGroup(resp []interface{}, err error) ([]interface{}, error)
- func (db *DB) ReturnInt64(resp int64, err error) (int64, error)
- func (db *DB) Save(Model interface{}) error
- func (db *DB) Select(columns ...string) *DB
- func (db *DB) Where(column string, operator string, value interface{}) *DB
- type Query
- func (query *Query) BuildConditions() error
- func (query *Query) BuildDelete() (sql string, args []interface{}, err error)
- func (query *Query) BuildInsert() (sql string, err error)
- func (query *Query) BuildJoin(Model interface{}) error
- func (query *Query) BuildSelect() (sql string, err error)
- func (query *Query) BuildUpdate() (sql string, args []interface{}, err error)
- type Where
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
DB ...
func Connect ¶
func Connect(dialect string, username string, password string, host string, port string, database string) (worm *DB, err error)
Connect establishes a new database connection
func (*DB) ReturnBool ¶
ReturnBool – TODO: Refactor to not use return functions to reset query.
func (*DB) ReturnError ¶
ReturnError – TODO: Refactor to not use return functions to reset query.
func (*DB) ReturnGroup ¶
ReturnGroup – TODO: Refactor to not use return functions to reset query.
func (*DB) ReturnInt64 ¶
ReturnInt64 – TODO: Refactor to not use return functions to reset query.
type Query ¶
type Query struct { Columns []string Params []string Values []interface{} Args []interface{} Select string Where string Join string GroupBy string Having string OrderBy string Limit string Offset string Table string Conditions []interface{} Joins []interface{} Model reflect.Value }
Query ...
func (*Query) BuildDelete ¶
BuildDelete ...
func (*Query) BuildInsert ¶
BuildInsert ...
func (*Query) BuildSelect ¶
BuildSelect ...
func (*Query) BuildUpdate ¶
BuildUpdate ...
Click to show internal directories.
Click to hide internal directories.