use query to get adapter