On Oct 11, 6:57 pm, Nate Wiger <[email protected]> wrote:
> And just to clarify Jeremy, I'm not trying to be a jerk. About 10
> years ago I wrote one of the first SQL query abstraction layers, in
> Perl, SQL::Abstract, which became the de facto standard for SQL
> "algebras" and inspired many toolsets from AR to DM to AREL to
> Hibernate to Pylons:
>
> http://search.cpan.org/~nwiger/SQL-Abstract-1.21/lib/SQL/Abstract.pm
>
> If you read thru the syntax you'll see many similarities with Sequel/
> AR/DM/Hibernate/etc syntax even though you many never have heard of
> SQL::A until just now.
>
> My point is this: Syntax is everything. That's why we're all using
> Ruby. The difference between:
>
> rows = User.filter('id > :x', :x => 20)
>
> And
>
> stmt = User.filter('id > ?', :$x).prepare
> stmt.call(:select, :x => 20)
>
> is HUGE, night-and-day. Chaining makes the difference between
> "awesome" and "lame". Think of the next step: Sequel::Model chained
> assocs (something I'd working on):
>
> class User < Sequel::Model
> def self.active
> where('is_active = ?', true)
> end
>
> def self.recent(date)
> where('created_at < :date', date)
> end
> end
>
> Then:
>
> Ueer.active.recent(Today.yesterday).all
>
> Like I said, there's no backwards compat issues based off the tests
> I've run. I think you'll find the suggestions I've provided are
> consistent with major DB's and will help extend Sequal's power. If
> not, fair enough, but I reserve the right to splinter Sequel and take
> it in new directions like the initial fork of AR.
Hopefully my previous message clarified my position.
I agree with you that syntax is hugely important, after all, that's
one of the primary advantages in using Sequel over AR. I know the
existing bound variable/prepared statement usage is cumbersome, which
is one of the reasons I only recommended using it after profiling.
Changing Sequel so you can go from:
User.filter('id > ?', :$x).call(:select, :x=>1)
to:
User.filter('id > ?', 1).all
and still get bound variable support is a noble goal. If it can be
accomplished without harming any other part of Sequel (see the 5
points in my previous message), I'm all 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
-~----------~----~----~----~------~----~------~--~---