query (DataMapper::Adapters::DataObjectsAdapter)

    # File lib/dm-core/adapters/data_objects_adapter.rb, line 168
          def query(statement, *bind_values)
            with_connection do |connection|
              reader = connection.create_command(statement).execute_reader(*bind_values)
              fields = reader.fields

              results = []

              begin
                if fields.size > 1
                  fields = fields.map { |field| Extlib::Inflection.underscore(field).to_sym }
                  struct = Struct.new(*fields)

                  while reader.next!
                    results << struct.new(*reader.values)
                  end
                else
                  while reader.next!
                    results << reader.values.at(0)
                  end
                end
              ensure
                reader.close
              end

              results
            end
          end