.where no longer accepts raw strings (I think since Sequel 5.0, but I could
be wrong). You can either pass hash arguments, as you demonstrated, or you
can use Sequel.lit.
For example:
DisplayOptions.where(Sequel.lit("id = ?", 0))
One thing I have found about Sequel is that you almost never have to pass
SQL conditions as strings. Even exceptionally complicated queries can be
built using the DSL syntax. But if you need to, you can always use
Sequel.lit.
On Thu, Jan 3, 2019 at 3:15 PM Charles A Cornell <[email protected]>
wrote:
> I am having trouble using the .where() dataset method with a string
> argument. Eventually I will have a much more complex condition to pass to
> where as a string but the following is sufficient to ask the question.
>
> *When I try this:*
>
> DisplayOptions.where("id = 0")
>
> *I get:*
>
> Sequel::Error: Invalid filter expression: "id = 0"
>
> *But the following works fine:*
>
> DisplayOptions.where(:id => 0)
>
>
> Any idea what is going wrong?
>
> Thanks,
> -Charles
>
> --
> You received this message because you are subscribed to the Google Groups
> "sequel-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sequel-talk.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.