Versions in this module Expand all Collapse all v1 v1.0.1 Oct 18, 2021 Changes in this version + const BetweenPattern + const EqualPattern + const GreaterThanOrEqualPattern + const GreaterThanPattern + const InPattern + const LessThanOrEqualPattern + const LessThanPattern + const LikePattern + var DBEmptyString = "EmpStr__" + var DBZero = "EmpZero__" + type DBProps struct + EnableScriptLog bool + Host string + Log logger.Logger + MaxIdleConns uint16 + MaxLifeTimeConns uint16 + MaxOpenConns uint16 + Name string + Pass string + Port uint16 + User string + type Database interface + CheckDBHealth func(in HealthIn) HealthOut + GetConnection func() *sql.DB + ItemDB func(in ItemIn) ItemOut + ItemsCounterDB func(in ItemsCounterIn) ItemsCounterOut + ItemsDB func(in ItemsIn) ItemsOut + NewItemDB func(in NewItemIn) NewItemOut + RemoveItemDB func(in RemoveItemIn) RemoveItemOut + RemoveItemsDB func(in RemoveItemIn) RemoveItemOut + RunScript func(in RunScriptIn) RunScriptOut + SelectScript func(in SelectScriptIn) SelectScriptOut + SetLogger func(logger.Logger) + SetProperties func(props DBProps) + UpdateItemDB func(in UpdateItemIn) UpdateItemOut + UpdateItemsDB func(in UpdateItemIn) UpdateItemOut + func New(d Driver, props DBProps) (Database, error) + type Driver string + const MongoDB + const MySQLDB + const PostgreSQLDB + const SQLiteDB + type FilterAllowed struct + Column string + Order string + Pattern string + Public map[string]interface{} + type HealthData struct + Current *string + type HealthIn struct + Micro string + Trace string + type HealthOut struct + Data interface{} + Message string + Micro string + Success bool + type ItemIn struct + CheckDuplicated bool + Dest interface{} + Label string + Script string + Trace string + type ItemOut struct + Item interface{} + ItemFound bool + Message string + Success bool + type ItemsCounterIn struct + Label string + Script string + Trace string + type ItemsCounterOut struct + ItemsCounter *uint32 + Message string + Success bool + type ItemsIn struct + CounterScript string + DefaultLimit uint32 + DefaultOrderBy string + Dest interface{} + EnableDefaultLimit bool + EnablePaging bool + FilterVals string + FiltersAllowed map[string]FilterAllowed + Label string + OrdersAllowed map[string]OrdersAllowed + OrdersVals string + PagingIndex uint32 + PagingSize uint32 + SelectScript string + Trace string + WhereScript string + type ItemsOut struct + Applied interface{} + DefaultLimit uint32 + FiltersAllowed []interface{} + HasFilter bool + HasPaging bool + Items interface{} + ItemsCounter uint32 + Message string + OrdersAllowed []interface{} + PagingSize uint32 + Success bool + type MySQL struct + func (mysql *MySQL) GetConnection() *sql.DB + func (o *MySQL) SetLogger(log logger.Logger) + func (o *MySQL) SetProperties(props DBProps) + func (obj *MySQL) CheckDBHealth(in HealthIn) HealthOut + 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 (obj MySQL) UpdateItemDB(in UpdateItemIn) UpdateItemOut + func (obj MySQL) UpdateItemsDB(in UpdateItemIn) UpdateItemOut + type NewItemIn struct + CheckDuplicated bool + Dest interface{} + Label string + Script string + Trace string + type NewItemOut struct + InsertId int64 + Message string + Success bool + type OrdersAllowed struct + Column string + Order string + Public map[string]interface{} + type RemoveItemIn struct + AffectedRowsScript string + CheckDuplicated bool + Dest interface{} + EnableAffectedRows bool + ExpectedAffectedRows uint32 + Label string + Script string + Trace string + type RemoveItemOut struct + Message string + Success bool + type RunScriptIn struct + Script string + Trace string + type RunScriptOut struct + AffectedRows int32 + ChangedRows int32 + Error error + LastInsertId int64 + type SelectScriptIn struct + Dest interface{} + Script string + Trace string + type SelectScriptOut struct + DataLen uint32 + Error error + type UpdateItemIn struct + AffectedRowsScript string + CheckDuplicated bool + Dest interface{} + EnableAffectedRows bool + ExpectedAffectedRows uint32 + Label string + Script string + Trace string + type UpdateItemOut struct + AffectedRows int32 + Message string + Success bool + type UtilsDB struct + func (mysql UtilsDB) AffectedRowsScript(table string, where string) 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 + 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