mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
Make Indexes storable in MySQL and Postgres
This commit is contained in:
committed by
Dan Christian Bogos
parent
7722265e11
commit
0da0f69e1c
@@ -290,7 +290,7 @@ const (
|
||||
LoadIDPrefix = "lid_"
|
||||
LoadInstKey = "load_history"
|
||||
CreateCDRsTablesSQL = "create_cdrs_tables.sql"
|
||||
CreateAccountsTablesSQL = "create_db_tables.sql"
|
||||
CreateDBTablesSQL = "create_db_tables.sql"
|
||||
CreateTariffPlanTablesSQL = "create_tariffplan_tables.sql"
|
||||
TestSQL = "TEST_SQL"
|
||||
MetaAsc = "*asc"
|
||||
@@ -1942,6 +1942,7 @@ const (
|
||||
TBLTrendProfiles = "trend_profiles"
|
||||
TBLTrends = "trends"
|
||||
TBLLoadIDs = "load_ids"
|
||||
TBLIndexes = "indexes"
|
||||
OldSMCosts = "sm_costs"
|
||||
TBLTPDispatchers = "tp_dispatcher_profiles"
|
||||
TBLTPDispatcherHosts = "tp_dispatcher_hosts"
|
||||
|
||||
@@ -162,6 +162,24 @@ func (s StringSet) FieldAsString(fldPath []string) (_ string, err error) {
|
||||
return "{}", nil // noting in it as is a empty structure
|
||||
}
|
||||
|
||||
// ToMapStringAny converts StringSet to map[string]any
|
||||
func (s StringSet) ToMapStringAny() map[string]any {
|
||||
out := make(map[string]any, len(s))
|
||||
for k, v := range s {
|
||||
out[k] = v
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// MapStringAnyToStringSet converts map[string]any to a StringSet.
|
||||
func MapStringAnyToStringSet(m map[string]any) StringSet {
|
||||
out := make(StringSet, len(m))
|
||||
for k := range m {
|
||||
out[k] = struct{}{}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// InterfaceToMapStringStringSet converts map[string]any to map[string]StringSet
|
||||
func InterfaceToMapStringStringSet(m any) map[string]StringSet {
|
||||
v, ok := m.(map[string]any)
|
||||
|
||||
Reference in New Issue
Block a user