Skip to content

Basic configuration database support in C++

Louis Moureaux requested to merge feature/configuration-cpp into main


This is the C++ side of !223 (merged), !224 (merged), and !225 (merged). I'm planning to keep all management logic in Python, with C++ doing simple queries.

In addition to the database, the configuration can be constructed from a layout tree and configuration files. The naming convention looks like fed-1468/backend_board-7/link-5/vfat-13.cfg; missing files are simply ignored and the configuration will contain no data for the corresponding components.

Related Issue

I see #121 is still open, let's use it for everything.

How Has This Been Tested?

So far:

auto conn = pqxx::connection("dbname=lmoureau user=*** password=***");
auto tx = pqxx::work(conn);
auto c = configuration(tx, 95);
std::cout << c.display_name() << std::endl;

c = configuration(tx, "cool");
std::cout << c.display_name() << std::endl;

c = configuration(tx, "cool", 3);
std::cout << c.display_name() << std::endl;

I also checked that the amount of data fetched from the database makes sense.

For the file-based constructor I checked the file names but didn't try to load any data.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)


  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
Edited by Louis Moureaux

Merge request reports