Add first version for tag metadata queries on MySQL database

Does not retry yet when first query fails (e.g. when tag is detected before metadata was added to the database).