On Apr 21, 6:44 am, Simon Arnaud <[email protected]> wrote: > Here are what I think : > * Do not compare Sequel to another ORM unless it's a page specific to > a comparison or a migration from. I never used AR, and it is confusing > to see it in advanced associations doc, for example.
Most Sequel users have some familiarity with AR. However, if any of the examples currently depend on knowledge of AR to be understandable, I'll certainly consider adding additional text with more explanation. > * clean out README, there's too much in it. Any recommendations on what should be cut? > * Have separate pages for models. Basic and advanced would be nice. For associations, there is an advanced page, and I'm working on a basic page. Most of the very basic model stuff is handled in the README. Is that the stuff you think should be moved to its own page? > * There's a lot of doc in the patch notes, it would be nice if some of > them could be integrated. For example, the :clone thing that was > discussed a few days ago. The basic associations page should cover that particular case, but you are correct that it is an issue in general. > * Write a contribute page. I would love to help, but I don't know how. > I understand I can fork GH and then send pull requests, but I'm not > sufficiently skilled to understand everything you expect as base > contribution : code style, tests, ... > Granted, I don't have much time anyway. The contribute page already exists (http://sequel.rubyforge.org/ development.html), though I suppose it could be fleshed out. I'm not too picky on code style or tests, as if I like a patch, I'll happily change the style or add tests. > * eager load could easily get a page on his own, it's a not a trivial > understanding imo. The advanced associations page has numerous examples of custom eager loading, assuming that's what you are referring to. This is a case where it probably helps to have some familiarity with AR, since Sequel's standard eager loading is fairly similar in concept. > As for improvements : > > * case syntax, as I mentionned on your blog, is very confusing. I > don't know how it could really be improved though. Maybe replacing it > with else would make it slightly less surprising. > > Ideally (for me) : > CASE WHEN > now : {{:a=>[2,3]}=>1}.case(0) > maybe : [ {:a => [2,3]}.then(1), {:b => 4}.then(2)].else(0) > > CASE c WHEN > now : {:a=>1, {:b=>2}].case(:d, :c) (typo from the doc) > maybe : :c.when([:a.then(1), :b.then(2)]).else(:d) It's obviously a matter of taste, but I much prefer the current syntax over your recommended replacement. I'm sorry if you find it confusing. It's certainly terse, but should not be difficult to understand that {{:a=>[2,3]}=>1}.case(0) is translated to "(CASE WHEN (a IN (2, 3)) THEN 1 ELSE 0 END)". > * ancestors and descendants (non-rcte) as a keyword would be really nice. > class Node < Sequel::Model > many_to_one :parent, :class=>self > one_to_many :children, :key=>:parent_id, :class=>self > ancestors :parent > descendants :children > end > > Node.filter(:id => 34).ancestors.all > Node.filter(:id => 34).descendants.all > Node.filter(:id => 34).descendants(3).all (depth of descendants) ancestors and descendants would only be used for tree structured data, and as such is a poor fit for something built in. In terms of a non- rcte tree plugin, sequel-plus (http://github.com/mwlang/sequel_plus) includes one. As to whether Sequel should ship with a non-rcte tree plugin, I'd be open to that if there was demand for it. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" 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/sequel-talk?hl=en.
