HomeSoftware Heritage

Refactor `relation_add` prepearing to move SQL queries into functions