On Apr 17, 7:55 am, akhil <[email protected]> wrote:
> Hi,
>
> For a few days now I have been running into problems with sequel code
> which was working earlier after in introduces facets.
> when using "~:hashtag" in filter instead of negating it it refers to
> column '~hashtag'
> Similarly when using  '|' in filter the query generated is 'and'.
> But i get no such problem with I use functions like or instead of '|'
>
> I have not tried with later versions for sequel though.
>
> After removing the facets the issues are all gone
>
> Has anyone faced any such problems and workarounds?

Facets and Sequel have a handful of methods in conflict, Symbol#~ and
Hash#| being two of them. There are a few ways to handle these
conflicts.

1) Load Facets before you load Sequel. This should allow Sequel to
override Facets' definitions where they conflict.
2) Cherry pick Facets. You can load just the methods you want to use,
and thus avoid any methods that conflict.
3) Turn Sequels core extensions off and do not use them (more on this
below).

Sequel defines a number of core extensions that are completely
specific to Sequel. Personally I think core extensions should always
be general purpose. While there may still be conflicts, they will be
much less likely.  I understand the motivation behind it, but it's
just not a very good idea. Thankfully Sequel is just as capable and
concise without using these extensions. Indeed, if it were not the
case I would not be using Sequel!

Recently Jeremy and I had a fairly good discussion on this issue. I am
of the opinion that Sequel extensions should be optional (e.g. a
secondary require like 'sequel/extended'). Jeremy is of the opinion
that it is not a serious enough issue, there are available work-
arounds as I mentioned above, and that changing this would cause too
much trouble b/c the extensions are widely used. I understand Jeremy's
position. I just think it would be better to make the common require
the safer option. Right now you can turn the extensions off by setting
SEQUEL_NO_CORE_EXTENSIONS = true before you require 'sequel'. To make
this a more convenient, I've asked Jeremy to provide a separate
require (e.g.  require 'sequel/noext'). I am looking forward to that.

-- 
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.

Reply via email to