[Bast-commits] r3843 - in DBIx-Class/0.08/trunk/lib/DBIx/Class: .
Manual
tomboh at dev.catalyst.perl.org
tomboh at dev.catalyst.perl.org
Mon Oct 29 17:19:02 GMT 2007
Author: tomboh
Date: 2007-10-29 17:19:01 +0000 (Mon, 29 Oct 2007)
New Revision: 3843
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm
Log:
Improve Documentation.
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod 2007-10-27 17:53:39 UTC (rev 3842)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Manual/FAQ.pod 2007-10-29 17:19:01 UTC (rev 3843)
@@ -419,6 +419,17 @@
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<DBIx::Class::ResultSource> 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
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2007-10-27 17:53:39 UTC (rev 3842)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2007-10-29 17:19:01 UTC (rev 3843)
@@ -1563,7 +1563,7 @@
=item Arguments: \%vals
-=item Return Value: $object
+=item Return Value: a L<DBIx::Class::Row> $object
=back
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm 2007-10-27 17:53:39 UTC (rev 3842)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSource.pm 2007-10-29 17:19:01 UTC (rev 3843)
@@ -980,7 +980,9 @@
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<DBIx::Class::ResultSet>, and set it here.
+L<DBIx::Class::ResultSet>, 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
More information about the Bast-commits
mailing list