[CDBI] find_or_create() usage or feature request

Carlos Ramirez carlos at quantumfx.com
Thu May 24 22:01:57 BST 2007


I like the functionality of find_or_create() however, i think it could
be better if it allowed you specify the search criteria and the actual
record data as seperate parameters like:

  ## find_or_create(\%search_criteria [,\%new_record]);
  Module->find_or_create({user_name => 'einstein'}, 
     { user_name => 'einstein', field => 'physics', fname => 'Albert'});

For instance, if I want to find or create a new record where I only want
to check that the user_name field doesn't already exist, before I insert
the record. The current implementation requires that you specify all the
new fields of the new record which are used as conditions for a search
... right?




More information about the ClassDBI mailing list