2 DBIx::Class::UUIDColumns - Implicit uuid columns
6 __PACKAGE__->load_components(qw/UUIDColumns Core DB/);
7 __PACKAGE__->uuid_columns( 'artist_id' );
10 This DBIx::Class component resembles the behaviour of Class::DBI::UUID,
11 to make some columns implicitly created as uuid.
13 When loaded, "UUIDColumns" will search for a suitable uuid generation
14 module from the following list of supported modules:
22 If no supporting module can be found, an exception will be thrown.
24 *APR::UUID will not be loaded under OpenBSD due to an as yet
25 unidentified XS issue.
27 If you would like to use a specific module, you can set "uuid_class":
29 __PACKAGE__->uuid_class('::Data::UUID');
30 __PACKAGE__->uuid_class('MyUUIDGenerator');
32 Note that the component needs to be loaded before Core.
35 uuid_columns(@columns)
36 Takes a list of columns to be filled with uuids during insert.
38 __PACKAGE__->uuid_columns('id');
40 uuid_class($classname)
41 Takes the name of a UUIDMaker subclass to be used for uuid value
42 generation. This can be a fully qualified class name, or a shortcut name
43 starting with :: that matches one of the available
44 DBIx::Class::UUIDMaker subclasses:
46 __PACKAGE__->uuid_class('CustomUUIDGenerator');
47 # loads CustomeUUIDGenerator
49 __PACKAGE->uuid_class('::Data::UUID');
50 # loads DBIx::Class::UUIDMaker::Data::UUID;
52 Note that "uuid_class" chacks to see that the specified class isa
53 DBIx::Class::UUIDMaker subbclass and throws and exception if it isn't.
56 Returns the current UUIDMaker instance for the given module.
58 my $uuid = __PACKAGE__->uuid_maker->as_string;
61 DBIx::Class::UUIDMaker
64 Chia-liang Kao <clkao@clkao.org> Chris Laco <claco@chrislaco.com>
67 You may distribute this code under the same terms as Perl itself.