Add support for saving metadata on queries.