honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
plins 2017-11-29T17:20:42.000358Z

hello everyone, is possible to achieve a where clause like (i.myData < now() - interval 15 day) within honeysql?

seancorfield 2017-11-29T17:55:37.000593Z

@plins You might have to resort to HoneySQL's raw helper function for that...

plins 2017-11-29T18:45:12.000018Z

managed to do it with raw! thank you!

bja 2017-11-29T20:22:47.000201Z

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

bja 2017-11-29T20:25:15.000389Z

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))]]

donaldball 2017-11-29T20:30:40.000247Z

I did just that with the new java.time.Duration type

bja 2017-11-29T20:38:12.000194Z

I really need to examine the java 8 datetime system so I can get off joda time

donaldball 2017-11-29T20:45:30.000434Z

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.

seancorfield 2017-11-29T21:10:43.000132Z

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.