From: Daniel Westermann-Clark Date: Sun, 18 Dec 2005 17:59:04 +0000 (+0000) Subject: Update examples to be more explicit about load_components order X-Git-Tag: v0.05005~129 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f4ccda688da4b8cd0350161f7d0d3a96a805c978;p=dbsrgits%2FDBIx-Class.git Update examples to be more explicit about load_components order --- diff --git a/lib/DBIx/Class/PK/Auto.pm b/lib/DBIx/Class/PK/Auto.pm index 2e3e4f3..6b5356a 100644 --- a/lib/DBIx/Class/PK/Auto.pm +++ b/lib/DBIx/Class/PK/Auto.pm @@ -22,12 +22,24 @@ This class overrides the insert method to get automatically incremented primary keys. You don't want to be using this directly - instead load the -appropriate one for your database, e.g. C, before -C. +appropriate one for your database, e.g. C, in your +table classes: + + __PACKAGE__->load_components(qw/PK::Auto::SQLite Core/); + +Note that C is specified as the leftmost argument. + +Alternatively, you can load the components separately: + + __PACKAGE__->load_components(qw/Core/); + __PACKAGE__->load_components(qw/PK::Auto::SQLite/); + +This can be used, for example, if you have different databases and +need to determine the appropriate C class at runtime. =head1 LOGIC -PK::Auto does this by letting the database assign the primary key +C does this by letting the database assign the primary key field and fetching the assigned value afterwards. =head1 METHODS