honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
donavan 2020-07-22T13:00:53.283500Z

I’m struggling to work out how to write a lateral join in hsql. How would I write something like this:

left join lateral (
    select json_agg(r.*) as ir
    from revisions r
    where r.item_id = i.id
) ir on truee
Thanks!

donavan 2020-07-22T13:12:59.283800Z

I managed to do it with honey/raw and [:= 1 1]. I also thought that maybe this is not standard SQL? I’m just really learning SQL via Postgres at the moment.

dharrigan 2020-07-22T14:07:31.284100Z

Yes, I believe it doesn't currently support lateral

dharrigan 2020-07-22T14:08:51.284600Z

It is rather PostgreSQL specific, so unlikely to be supported in HoneySQL any time.

seancorfield 2020-07-22T15:54:44.284800Z

@donavan You could request it be added to this https://github.com/nilenso/honeysql-postgres which is PostgreSQL-specific extensions to HoneySQL.

donavan 2020-07-22T15:57:07.285100Z

Thanks both 🙂 . I’ll try create a PR for https://github.com/nilenso/honeysql-postgres otherwise just request it