~$ DBIC_TRACE_PROFILE=console perl -It/lib -MDBICTest -e ' my $s = DBICTest->init_schema; $s->storage->debug(1); $s->resultset("Artist")->create({ name => "beh", cds => [{ cdid => 666, year => 0, title => "buh", tracks => [{ title => "eeeh" }] }] }) ' BEGIN WORK INSERT INTO artist( name ) VALUES( 'beh' ) INSERT INTO cd( artist, cdid, title, year ) VALUES( '4', '666', 'buh', '0' ) SELECT me.position FROM track me WHERE cd = '666' ORDER BY position DESC LIMIT '1' INSERT INTO track( cd, position, title ) VALUES( '666', '1', 'eeeh' ) COMMIT