Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

DBIx::Class insert nested hash

by Anonymous Monk
on Nov 15, 2021 at 10:23 UTC ( #11138826=perlquestion: print w/replies, xml ) Need Help??

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 (Monsignor) on Nov 16, 2021 at 09:03 UTC
      thank you! Exactly what I was looking for!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11138826]
Approved by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2022-01-21 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?