I m 要求Ruby ORM取代“积极记录”。 我一直在研究Sequel和数据Mapper。 然而,他们看上去看不到什么基本东西:在你不需要时,不要把所有东西装上记忆。
我指的是,我以几行之分在桌旁对“积极记录”和“后遗症”进行了如下(或等同)审判:
posts.each { |p| puts p }
两人都记忆犹新。 他们似乎装上一切的记忆,而不是在需要时打脚。 我在主动查阅中使用<代码>find_in_batches,但这不是一个可以接受的解决办法:
- ActiveRecord is not an acceptable solution because we had too many problems with it.
Why should my code be aware of a paging mechanism? I m happy to configure somewhere the size of the page but that s it. With
find_in_batches
you need to do something like:员额:find_ches{>batch batch.each{> > > >
But that should be transparent.
因此,在什么地方有一个可靠的Ruby ORM?
Update:
As Sergio mentioned, in Rails 3 you can use find_each
which exactly what I want. However as ActiveRecord is not an option, except if someone can really convince me to use it, the questions are:
- Which ORMs support the equivalent of find_each?
- How to do it?
- Why do we need a
find_each
, whilefind
should do it, shouldn t it?