query adapter