2 DBIx::Class::UUIDColumns - Implicit uuid columns
\r
5 In your DBIx::Class table class:
\r
7 __PACKAGE__->load_components(qw/UUIDColumns ... Core/);
\r
8 __PACKAGE__->uuid_columns('artist_id');
\r
10 Note: The component needs to be loaded *before* Core.
\r
13 This DBIx::Class component resembles the behaviour of Class::DBI::UUID,
\r
14 to make some columns implicitly created as uuid.
\r
16 When loaded, "UUIDColumns" will search for a suitable uuid generation
\r
17 module from the following list of supported modules:
\r
25 If no supporting module can be found, an exception will be thrown.
\r
27 *APR::UUID will not be loaded under OpenBSD due to an as yet
\r
28 unidentified XS issue.
\r
30 If you would like to use a specific module, you can set "uuid_class":
\r
32 __PACKAGE__->uuid_class('::Data::UUID');
\r
33 __PACKAGE__->uuid_class('MyUUIDGenerator');
\r
37 Returns a uuid string from the current uuid_maker.
\r
40 Inserts a new uuid string into each column in "uuid_columns".
\r
43 Takes a list of columns to be filled with uuids during insert.
\r
45 __PACKAGE__->uuid_columns('artist_id');
\r
48 Takes the name of a UUIDMaker subclass to be used for uuid value
\r
49 generation. This can be a fully qualified class name, or a shortcut name
\r
50 starting with :: that matches one of the available
\r
51 DBIx::Class::UUIDColumns::UUIDMaker subclasses:
\r
53 __PACKAGE__->uuid_class('CustomUUIDGenerator');
\r
54 # loads CustomeUUIDGenerator
\r
56 __PACKAGE__->uuid_class('::Data::UUID');
\r
57 # loads DBIx::Class::UUIDMaker::Data::UUID;
\r
59 Note that "uuid_class" checks to see that the specified class isa
\r
60 DBIx::Class::UUIDColumns::UUIDMaker subclass and throws and exception if
\r
64 Returns the current UUIDMaker instance for the given module.
\r
66 my $uuid = __PACKAGE__->uuid_maker->as_string;
\r
69 DBIx::Class::UUIDColumns::UUIDMaker
\r
72 Chia-liang Kao <clkao@clkao.org>
\r
75 Chris Laco <claco@chrislaco.com>
\r
78 You may distribute this code under the same terms as Perl itself.
\r