Implement rawQuery function.