X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FPK%2FAuto.pm;h=6b5356a9b2c4a19f62bb96fcd881b27f89308b55;hb=f4ccda688da4b8cd0350161f7d0d3a96a805c978;hp=2e3e4f3cff35837862ef9cc71aa0256d2a1c9328;hpb=6718c5f0bf2bb9528c055b5974488a6d37f1209a;p=dbsrgits%2FDBIx-Class.git 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