honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
adam 2020-07-10T22:09:00.191500Z

How is it possible to say INSERT ... ON CONFLICT DO NOTHING?

seancorfield 2020-07-10T22:19:39.192Z

@somedude314 That's PostgreSQL-specific -- you'll need to use https://github.com/nilenso/honeysql-postgres for that.

seancorfield 2020-07-10T22:20:47.192500Z

I see it has examples of on conflict do nothing in the tests https://github.com/nilenso/honeysql-postgres/blob/feb22bf7a164a23d4dbcffba35c3af4f3e4e38a3/test/honeysql_postgres/postgres_test.cljc#L26-L37

adam 2020-07-10T22:32:28.193300Z

Thanks Sean. I am a little hesitant about leaving the main library just for this.

seancorfield 2020-07-10T22:48:09.194100Z

HoneySQL is about portable, mostly ANSI SQL compliant syntax. PostgreSQL-specific stuff always requires that nilenso library 🙂

seancorfield 2020-07-10T22:49:15.195200Z

It is strictly an extension to HoneySQL -- so you wouldn't be "leaving" the main library, you'd just be "also using" the extensions. Not sure why that worries you @somedude314?

adam 2020-07-10T23:29:08.197Z

I assume when HoneySQL gets updated, I will have to wait for that library to update HoneySQL version. I will give it a try and see anyhow 🙂

seancorfield 2020-07-10T23:31:41.197400Z

I'm not sure what you mean @somedude314?

seancorfield 2020-07-10T23:32:13.198Z

You depend on HoneySQL and you depend on the pg-extension library. There's no issue of versions or waiting.

adam 2020-07-10T23:33:58.199300Z

Ah, so you mean I can keep honeysql listed in my project.clj in addition to nilenso/honeysql-postgres.

adam 2020-07-10T23:34:38.199900Z

What I did was removing honeysql as a direct dependency

seancorfield 2020-07-10T23:34:45.200100Z

Why?

seancorfield 2020-07-10T23:34:59.200500Z

Your code still depends on honeysql so it should be a direct dependency.

adam 2020-07-10T23:35:55.201300Z

cluelessness 🙂

seancorfield 2020-07-10T23:36:15.201800Z

I would recommend always listing all your direct dependencies, with specific versions that you want to use -- and only switching those versions if it causes a specific conflict.

adam 2020-07-10T23:36:54.202400Z

Makes total sense. Will do that. Thanks.