From: Tom Hukins Date: Mon, 29 Oct 2007 17:19:01 +0000 (+0000) Subject: Improve Documentation. X-Git-Tag: v0.08010~40 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4773415182471889a8ac44f72dae1547e331307;p=dbsrgits%2FDBIx-Class.git Improve Documentation. --- diff --git a/lib/DBIx/Class/Manual/FAQ.pod b/lib/DBIx/Class/Manual/FAQ.pod index 434a1b1..aa7cf30 100644 --- a/lib/DBIx/Class/Manual/FAQ.pod +++ b/lib/DBIx/Class/Manual/FAQ.pod @@ -419,6 +419,17 @@ is executed. You can create further resultset refinements by calling search again or relationship accessors. The SQL query is only run when you ask the resultset for an actual row object. +=item How do I deal with tables that lack a primary key? + +If your table lacks a primary key, DBIx::Class can't work out which row +it should operate on, for example to delete or update. However, a +UNIQUE constraint on one or more columns allows DBIx::Class to uniquely +identify the row, so you can tell L these +columns act as a primary key, even if they don't from the database's +point of view: + + $resultset->set_primary_key(@column); + =back =head2 Notes for CDBI users diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 05fbc41..c72b38b 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1563,7 +1563,7 @@ sub find_or_new { =item Arguments: \%vals -=item Return Value: $object +=item Return Value: a L $object =back diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 23fdd40..a11f97f 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -980,7 +980,9 @@ but is cached from then on unless resultset_class changes. Set the class of the resultset, this is useful if you want to create your own resultset methods. Create your own class derived from -L, and set it here. +L, and set it here. If called with no arguments, +this method returns the name of the existing resultset class, if one +exists. =head2 resultset_attributes