Fork me on GitHub
#honeysql
<
2021-06-29
>
Krishan V05:06:48

Hey everyone, I am trying to insert 3 new records into two tables at the same time. The first record that goes into Table A looks somewhat like {:id "" :name ""} while the second and third record that goes into Table B looks like {:a_id "" :country_id ""} where a_id is a foreign key constraint. How do I go about creating records through association with honeysql? Is there a reading or somewhere in the docs where I can try to self-serve from?

seancorfield06:06:19

@krishanvj I'm afraid I don't understand what you're trying to do... HoneySQL is just a DSL to create SQL from Clojure data structures so if you don't know what the SQL should be, we're not going to be able to help you figure out what the DSL should be.

Krishan V08:06:30

I see, I'll have to shake off my ORM habits. I've decided to go with separate insert statements and have resolved this issue. Thanks anyways!