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