hugsql

2018-02-08T05:08:27.000168Z

is it possible to parameterize the table names in hugsql?

2018-02-09T15:42:55.000529Z

i believe it is. look at identities

2018-02-09T16:27:22.000027Z

can you point to the docs somwehre? i dont' see anything about identities

2018-02-10T03:16:12.000036Z

sorry i meant identifiers: https://www.hugsql.org/#param-identifier

2018-02-10T03:30:34.000023Z

ah neat! thanks dunno how i missed that 😊

2018-02-10T03:39:46.000154Z

np. i had the same question. I think if you want to do lot of composing then you might want honey sql. my gut tells me there is nothing wrong with mixing the two libs/approaches

2018-02-10T03:40:05.000070Z

their pros and cons complement each other

2018-02-10T03:40:43.000095Z

hug is straight forward and the most direct path. Honey itches the scratch of being able to build sql queries programmatically.

2018-02-10T03:41:40.000076Z

datomic solves both issues in so far as i can tell.

2018-02-10T03:54:39.000090Z

i completely agree with you, hugsql makes me end up writing my won dsl -- in the cases where i want to make advantage of postgres's functoinaitly it's easier to use hugsql for that case

2018-02-10T03:54:52.000051Z

i'd love to use datomic 😊 haha, one day

2018-02-08T06:36:44.000160Z

seems not, it's not part of JDBC's prepared statement, so I shouldnt -- in the meantime, I've been able to do this to get sqlvec's handily:

(defn delete-query [table column values]
  (let [f (hugsql.core/sqlvec-fn (format "delete * from %s where %s IN (:v:values)" table column)]
    (f {:value values}))))

(delete-query "foo" "id" [1 2 3 4])
;; ["delete * from foo where id IN ( ? )" [1 2 3 4]]

rovanion 2018-02-08T14:24:23.000294Z

This is of course a bit off topic but does nyone know of libraries like HugSQL but for Python?

2018-02-08T19:24:45.000177Z

@rovanion never tried it myself

2018-02-08T19:24:45.000572Z

https://github.com/semirook/snaql