Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've been watching David Cross' "Database Programming with Perl and DBIx::Class" presentation
which has an example of an Artist who has many CD's and in slide 70 he inserts the associated cds with $bowie->add_to_cds{}
Isn't there a way to insert a nested Artist hash which would include another hash with the artist's cds in one go, populating both the Artist and its related CDs table?
I mean something like passing the nested Artist hash inside a create method which would then take care of inserting the data appropriately.

Replies are listed 'Best First'.
Re: DBIx::Class insert nested hash
by bliako (Abbot) on Nov 16, 2021 at 09:03 UTC
      thank you! Exactly what I was looking for!