Include database query in requests