On Tuesday, October 3, 2017 at 12:33:55 PM UTC-7, Grant Schoep wrote:
>
> So I'm learning the DSL of sequel instead of straight sql, there is one
> thing I can't figure out.
>
> So I have a "TIMESTAMP WITH TIMEZONE" field in a table I am trying to do a
> select from.
>
> In sql I would just do
> select id from some_metadata where ('2017-08-02T04:34:16Z' >=
> somestoptime);
>
> However, I'm trying to figure out how to do that in the sequel DSL. I tried
>
> DB[:some_metadata].select{id}.where{'2017-08-02T04:34:16Z' >=
> somestoptime}
>
>
> But that errors with "syntax error comparison of String with
> Sequel::SQL::Identifier failed"
>
> Maybe the >=, < isn't right way to compare timestamps?
>
>
You just have to wrap the object in a Sequel expression:
DB[:some_metadata].select(:id).where(Sequel['2017-08-02T04:34:16Z'] >=
:somestoptime)
Thanks,
Jeremy
--
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.