Put the database-specific query into a dedicated class and add define/header to select the database we want.
Retreive the ID of the inserted add-on.