add driver code for activerecord queries