MCPcopy Create free account
hub / github.com/Icinga/icinga2 / FillIDCache

Method FillIDCache

lib/db_ido_pgsql/idopgsqlconnection.cpp:1059–1074  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057}
1058
1059void IdoPgsqlConnection::FillIDCache(const DbType::Ptr& type)
1060{
1061 String query = "SELECT " + type->GetIDColumn() + " AS object_id, " + type->GetTable() + "_id, config_hash FROM " + GetTablePrefix() + type->GetTable() + "s";
1062 IncreasePendingQueries(1);
1063 IdoPgsqlResult result = Query(query);
1064
1065 Dictionary::Ptr row;
1066
1067 int index = 0;
1068 while ((row = FetchRow(result, index))) {
1069 index++;
1070 DbReference dbref(row->Get("object_id"));
1071 SetInsertID(type, dbref, DbReference(row->Get(type->GetTable() + "_id")));
1072 SetConfigHash(type, dbref, row->Get("config_hash"));
1073 }
1074}
1075
1076int IdoPgsqlConnection::GetPendingQueryCount() const
1077{

Callers

nothing calls this directly

Calls 4

DbReferenceClass · 0.85
GetIDColumnMethod · 0.80
GetTableMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected