Hey Daniel, Sorry i totally missed your previous replies!
I'm glad to hear that it (sort of) worked for you. The sorting on queries is indeed one of DM's shortcomings for SQL backends at the moment. There is some work afoot, and an endpoint for generating query objects for a specific backend (or set of backends), that may make this sort of thing possible (and easy). It would be awesome to see a write up on this subject, just so if people encounter this, they know how you solved it! This would make a great blog post :D -Ted On Tue, Sep 14, 2010 at 8:30 PM, Daniel Ribeiro <[email protected]> wrote: > Actually Ted, it does work, even with limit and offset, provided you > add a dummy field that is computed on the sql query, and is null for > all instances, but yes, it does work. > > The gem Sequel has more support for these things, but for the time > being, it will do. > > Thanks again. > > On Sep 13, 2:31 am, Daniel Ribeiro <[email protected]> wrote: > > Actually, spoke a bit too soon. The paging works, however, it messes > > up ordered results. Which is really sad when the order is defined by a > > sql function, and not a field of the model. > > > > Well, guess adapting the paging will be the only way out.... > > > > On Sep 13, 2:21 am, Daniel Ribeiro <[email protected]> wrote: > > > > > Thank you a lot. It works great after a simple find_by_sql. It will > > > not work on queries that do not return models, but so far so good. By > > > the time we need to return something other than models, we will be in > > > so much trouble that we will probably have to look into mongodb/riak/ > > > couchdb, and paging will be the least of our problems. > > > > > Great tip! > > > > > On Sep 13, 12:25 am, Ted Han <[email protected]> wrote: > > > > > > Hey Daniel, > > > > > > I haven't seen/used dm-pager, but if it functions on collections in > memory, > > > > the dm-ar-finders wrap the results from SQL queries. If however it > relies > > > > on addind the limit and offset flags for a query, this won't work. > > > > > > On Sep 12, 2010 11:08 PM, "Daniel Ribeiro" <[email protected]> > wrote:> We use dm-pager to do pagination, and it has worked wonders so far. > > > > > However, it doesn't work on direct queries made through > > > > > repository.adapter. Is there another plugin/fork that enables it? > > > > > > > -- > > > > > You received this message because you are subscribed to the Google > Groups > > > > "DataMapper" group. > > > > > To post to this group, send email to [email protected]. > > > > > To unsubscribe from this group, send email to > > > > > > [email protected]<datamapper%[email protected]> > <datamapper%[email protected]<datamapper%[email protected]> > > > > > > .> For more options, visit this group at > > > > > >http://groups.google.com/group/datamapper?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "DataMapper" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<datamapper%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/datamapper?hl=en. > > -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
