Fork me on GitHub

So this might come off as a dumb question (perhaps I’m just failing at my google fu), but is there a way to parameterize for multiple rows? Basically I have

INSERT INTO foo (a, b, c)
VALUES -- looking what to put here for parameterizing multiple rows
-- a bunch of other stuff not supported by my ORM


Do I need to make code to generate n number of (?, ?, ?) rows to insert into the prepared statement?


@bwstearns does this work ((?, ?, ?), (?, ?, ?))? or (?, ?, ?), (?, ?, ?)


@bwstearns correct, using the raw sql strings there's no way to do that.! attempts to make it so you don't need to do that, but as far as I know that won't work with on conflict. For queries like this either you need to generate n number of (?, ?, ?) rows, or use a helper library (like hugsql or honeysql). I personally think things like this are easier done with honeysql


thanks for the input. I think my googling had gotten too verbose so I was getting lots of non-relevant answers, so I guess i need to build out the n dummy strings before combining them.