hello everyone, is possible to achieve a where clause like (i.myData < now() - interval 15 day)
within honeysql?
@plins You might have to resort to HoneySQL's raw
helper function for that...
managed to do it with raw
! thank you!
if you're doing that often, you might look into converting the type you use to represent the interval (say org.joda.time.Days
) into interval 15 day
at the clojure.jdbc level via jdbc/ISQLValue
if you had such a thing in place, you could say:
[:< my-data [:- (honeysql.core/call :now) (honeysql.format/value (clj-time.core/days 15))]]
I did just that with the new java.time.Duration
type
I really need to examine the java 8 datetime system so I can get off joda time
It’s almost a perfect drop-in replacement for joda-time at the class level, just a bunch of renames. java-time
is a fine clojure wrapper, I actually like it better than clj-time
in some respects.
Yeah, another 👍:skin-tone-2: for clojure.java-time
-- we're switching to that from a mix of date-clj
, clj-time
, and raw Java interop.