Documentation
¶
Index ¶
- Constants
- Variables
- type DBProps
- type Database
- type Driver
- type FilterAllowed
- type HealthData
- type HealthIn
- type HealthOut
- type ItemIn
- type ItemOut
- type ItemsCounterIn
- type ItemsCounterOut
- type ItemsIn
- type ItemsOut
- type MySQL
- func (obj *MySQL) CheckDBHealth(in HealthIn) HealthOut
- func (mysql *MySQL) GetConnection() *sql.DB
- func (obj MySQL) ItemDB(in ItemIn) ItemOut
- func (obj MySQL) ItemsCounterDB(in ItemsCounterIn) ItemsCounterOut
- func (obj MySQL) ItemsDB(in ItemsIn) ItemsOut
- func (obj MySQL) NewItemDB(in NewItemIn) NewItemOut
- func (obj MySQL) RemoveItemDB(in RemoveItemIn) RemoveItemOut
- func (obj MySQL) RemoveItemsDB(in RemoveItemIn) RemoveItemOut
- func (obj MySQL) RunScript(in RunScriptIn) RunScriptOut
- func (obj MySQL) SelectScript(in SelectScriptIn) SelectScriptOut
- func (o *MySQL) SetLogger(log logger.Logger)
- func (o *MySQL) SetProperties(props DBProps)
- func (obj MySQL) UpdateItemDB(in UpdateItemIn) UpdateItemOut
- func (obj MySQL) UpdateItemsDB(in UpdateItemIn) UpdateItemOut
- type NewItemIn
- type NewItemOut
- type OrdersAllowed
- type RemoveItemIn
- type RemoveItemOut
- type RunScriptIn
- type RunScriptOut
- type SelectScriptIn
- type SelectScriptOut
- type UpdateItemIn
- type UpdateItemOut
- type UtilsDB
- func (mysql UtilsDB) AffectedRowsScript(table string, where string) string
- func (obj UtilsDB) BuildFilter(filtersAllowed map[string]FilterAllowed, filtersVals string) string
- func (obj UtilsDB) BuildOrder(filtersAllowed map[string]FilterAllowed, filtersVals string, ...) string
- func (obj UtilsDB) BuildPaging(data ItemsIn) string
- func (mysql UtilsDB) ColsScript(i interface{}, alias string) string
- func (mysql UtilsDB) DeleteScript(table string, where string) string
- func (mysql UtilsDB) InsertScript(table string, i interface{}) string
- func (mysql UtilsDB) UpdateScript(table string, i interface{}, where string) string
- func (mysql UtilsDB) WhereScript(i interface{}, joinClause string, alias string) string
Constants ¶
View Source
const ( EqualPattern string = `%v = '%v'` LikePattern string = `%v LIKE '%%%v%%'` BetweenPattern string = `%v BETWEEN '%v' AND '%v'` InPattern string = `%v IN (%v)` GreaterThanPattern string = `%v > '%v'` GreaterThanOrEqualPattern string = `%v >= '%v'` LessThanPattern string = `%v < '%v'` LessThanOrEqualPattern string = `%v <= '%v'` )
Patterns
Variables ¶
View Source
var ( // DBEmptyString variable para definir un campo vacio DBEmptyString = "EmpStr__" // DBZero variable para definir un campo numerico cero DBZero = "EmpZero__" )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface {
SetLogger(logger.Logger)
SetProperties(props DBProps)
GetConnection() *sql.DB
CheckDBHealth(in HealthIn) HealthOut
NewItemDB(in NewItemIn) NewItemOut
UpdateItemsDB(in UpdateItemIn) UpdateItemOut
UpdateItemDB(in UpdateItemIn) UpdateItemOut
RemoveItemsDB(in RemoveItemIn) RemoveItemOut
RemoveItemDB(in RemoveItemIn) RemoveItemOut
ItemsCounterDB(in ItemsCounterIn) ItemsCounterOut
ItemDB(in ItemIn) ItemOut
ItemsDB(in ItemsIn) ItemsOut
RunScript(in RunScriptIn) RunScriptOut
SelectScript(in SelectScriptIn) SelectScriptOut
// contains filtered or unexported methods
}
ClientDB interfaz cliente de Base de datos
type FilterAllowed ¶
type FilterAllowed struct {
Column string `json:"-"`
Order string `json:"-"`
Pattern string `json:"-"`
Public map[string]interface{} `json:"public,omitempty"`
}
ItemsDB
type HealthOut ¶
type HealthOut struct {
Success bool `json:"success"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
Micro string `json:"micro"`
}
HealthDB
type ItemIn ¶
type ItemIn struct {
Script string
CheckDuplicated bool
Dest interface{}
Trace string
Label string
}
ItemDB
type ItemOut ¶
type ItemOut struct {
Success bool `json:"success"`
ItemFound bool `json:"itemFound"`
Message string `json:"message,omitempty"`
Item interface{} `json:"item,omitempty"`
}
ItemDB
type ItemsCounterIn ¶
ItemsCounterDB
type ItemsCounterOut ¶
type ItemsCounterOut struct {
Success bool `json:"success"`
Message string `json:"message"`
ItemsCounter *uint32 `db:"itemsCounter"`
}
ItemsCounterDB
type ItemsIn ¶
type ItemsIn struct {
SelectScript string
WhereScript string
CounterScript string
FiltersAllowed map[string]FilterAllowed
FilterVals string
OrdersAllowed map[string]OrdersAllowed
OrdersVals string
DefaultOrderBy string
EnablePaging bool
PagingSize uint32
PagingIndex uint32
EnableDefaultLimit bool
DefaultLimit uint32
Dest interface{}
Trace string
Label string
}
ItemsDB
type ItemsOut ¶
type ItemsOut struct {
Success bool `json:"success"`
Message string `json:"message"`
Items interface{} `json:"items"`
HasFilter bool `json:"hasFilter"`
HasPaging bool `json:"hasPaging"`
ItemsCounter uint32 `json:"itemsCounter"`
PagingSize uint32 `json:"pagingSize"`
DefaultLimit uint32 `json:"defaultLimit"`
Applied interface{} `json:"applied,omitempty"`
FiltersAllowed []interface{} `json:"filtersAllowed,omitempty"`
OrdersAllowed []interface{} `json:"ordersAllowed,omitempty"`
}
ItemsDB
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func (*MySQL) CheckDBHealth ¶
func (*MySQL) GetConnection ¶
func (MySQL) ItemsCounterDB ¶
func (obj MySQL) ItemsCounterDB(in ItemsCounterIn) ItemsCounterOut
func (MySQL) NewItemDB ¶
func (obj MySQL) NewItemDB(in NewItemIn) NewItemOut
func (MySQL) RemoveItemDB ¶
func (obj MySQL) RemoveItemDB(in RemoveItemIn) RemoveItemOut
func (MySQL) RemoveItemsDB ¶
func (obj MySQL) RemoveItemsDB(in RemoveItemIn) RemoveItemOut
func (MySQL) RunScript ¶
func (obj MySQL) RunScript(in RunScriptIn) RunScriptOut
func (MySQL) SelectScript ¶
func (obj MySQL) SelectScript(in SelectScriptIn) SelectScriptOut
func (*MySQL) SetProperties ¶
func (MySQL) UpdateItemDB ¶
func (obj MySQL) UpdateItemDB(in UpdateItemIn) UpdateItemOut
func (MySQL) UpdateItemsDB ¶
func (obj MySQL) UpdateItemsDB(in UpdateItemIn) UpdateItemOut
type NewItemIn ¶
type NewItemIn struct {
Script string
CheckDuplicated bool
Dest interface{}
Trace string
Label string
}
NewItemDB
type NewItemOut ¶
type NewItemOut struct {
Success bool `json:"success"`
Message string `json:"message"`
InsertId int64 `json:"insertId"`
}
NewItemDB
type OrdersAllowed ¶
type OrdersAllowed struct {
Column string `json:"-"`
Order string `json:"-"`
Public map[string]interface{} `json:"public,omitempty"`
}
ItemsDB
type RemoveItemIn ¶
type RemoveItemIn struct {
Script string
AffectedRowsScript string
CheckDuplicated bool
EnableAffectedRows bool
ExpectedAffectedRows uint32
Dest interface{}
Trace string
Label string
}
RemoveItemDB
type RemoveItemOut ¶
RemoveItemDB
type RunScriptOut ¶
type RunScriptOut struct {
Error error `json:"error"`
AffectedRows int32 `json:"affectedRows"`
LastInsertId int64 `json:"lastInsertId"`
ChangedRows int32 `json:"changedRows"`
}
RunScript
type SelectScriptIn ¶
SelectScript
type SelectScriptOut ¶
SelectScript
type UpdateItemIn ¶
type UpdateItemOut ¶
type UtilsDB ¶
type UtilsDB struct {
}
func (UtilsDB) AffectedRowsScript ¶
func (UtilsDB) BuildFilter ¶
func (obj UtilsDB) BuildFilter(filtersAllowed map[string]FilterAllowed, filtersVals string) string
func (UtilsDB) BuildOrder ¶
func (obj UtilsDB) BuildOrder(filtersAllowed map[string]FilterAllowed, filtersVals string, ordersAllowed map[string]OrdersAllowed, orderVals string) string
func (UtilsDB) BuildPaging ¶
func (UtilsDB) ColsScript ¶
ColsScript .
func (UtilsDB) InsertScript ¶
InsertScript .
func (UtilsDB) UpdateScript ¶
UpdateScript .
Click to show internal directories.
Click to hide internal directories.