October 2025 Archives

I made a multiple-insert as well as other methods for Mojo::Pg

The code is in this gist

insert_multi_p will let you insert multiple rows in Postgres with a single query, like this:


await $db->insert_multi_p(
    'table_name',
    [
       {
          ... anything you'd be able to write in insert_p ...
       },
       {
           ... second row to insert ...
       },
       ... etc ...
    ],
    {
         ...normal pg insert options...
    },
);

Lots of other interesting methods in there, that I use in my proj…

About karjala

user-pic I'm a Perl developer.