Wrapper for queries over the tracked database.