Sha256: e3a4f9cdf85e4bf0e9ef8038cfe21b37096da13e8cb0aa0abe461ffc3eaf1214

Contents?: true

Size: 1.11 KB

Versions: 4

Compression:

Stored size: 1.11 KB

Contents

# dm-chunked_query

* [Source](http://github.com/postmodern/dm-chunked_query)
* [Issues](http://github.com/postmodern/dm-chunked_query/issues)
* [Documentation](http://rubydoc.info/gems/dm-chunked_query/frames)
* [Email](mailto:postmodern.mod3 at gmail.com)

## Description

Allows performing chunked queries on DataMapper Models or Collections.

## Features

* Allows random-access to chunks within a query.
* Can iterate through all chunks within a query.
* Can be used for bulk-processing of resources.
* Can also be used for pagination of resources.

## Examples

Enumerate over all chunks, 20 resources per-chunk:

    require 'dm-chunked_query'

    MyModel.chunks(20).each do |chunk|
      chunk.each do |resource|
        # ...
      end
    end

Get the 5th chunk, containing 10 resources:

    MyModel.all(:foo => 'bar').chunks(10)[5]

## Requirements

* [dm-core](http://github.com/datamapper/dm-core#readme) ~> 1.0
* [dm-aggregates](http://github.com/datamapper/dm-aggregates#readme) ~> 1.0

## Install

    $ gem install dm-chunked_query

## Copyright

Copyright (c) 2011 Hal Brodigan

See {file:LICENSE.txt} for details.

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dm-chunked_query-0.2.0 README.md
dm-chunked_query-0.1.2 README.md
dm-chunked_query-0.1.1 README.md
dm-chunked_query-0.1.0 README.md