Commit | Line | Data |
3469b243 |
1 | NAME\r |
2 | DBIx::Class::UUIDColumns - Implicit uuid columns\r |
3 | \r |
4 | SYNOPSIS\r |
5 | In your DBIx::Class table class:\r |
6 | \r |
7 | __PACKAGE__->load_components(qw/UUIDColumns ... Core/);\r |
8 | __PACKAGE__->uuid_columns('artist_id');\r |
9 | \r |
10 | Note: The component needs to be loaded *before* Core.\r |
11 | \r |
12 | DESCRIPTION\r |
13 | This DBIx::Class component resembles the behaviour of Class::DBI::UUID,\r |
14 | to make some columns implicitly created as uuid.\r |
15 | \r |
16 | When loaded, "UUIDColumns" will search for a suitable uuid generation\r |
17 | module from the following list of supported modules:\r |
18 | \r |
19 | Data::UUID\r |
20 | APR::UUID*\r |
21 | UUID\r |
22 | Win32::Guidgen\r |
23 | Win32API::GUID\r |
24 | \r |
25 | If no supporting module can be found, an exception will be thrown.\r |
26 | \r |
27 | *APR::UUID will not be loaded under OpenBSD due to an as yet\r |
28 | unidentified XS issue.\r |
29 | \r |
30 | If you would like to use a specific module, you can set "uuid_class":\r |
31 | \r |
32 | __PACKAGE__->uuid_class('::Data::UUID');\r |
33 | __PACKAGE__->uuid_class('MyUUIDGenerator');\r |
34 | \r |
35 | METHODS\r |
36 | get_uuid\r |
37 | Returns a uuid string from the current uuid_maker.\r |
38 | \r |
39 | insert\r |
40 | Inserts a new uuid string into each column in "uuid_columns".\r |
41 | \r |
42 | uuid_columns\r |
43 | Takes a list of columns to be filled with uuids during insert.\r |
44 | \r |
45 | __PACKAGE__->uuid_columns('artist_id');\r |
46 | \r |
47 | uuid_class\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 |
52 | \r |
53 | __PACKAGE__->uuid_class('CustomUUIDGenerator');\r |
54 | # loads CustomeUUIDGenerator\r |
55 | \r |
56 | __PACKAGE__->uuid_class('::Data::UUID');\r |
57 | # loads DBIx::Class::UUIDMaker::Data::UUID;\r |
58 | \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 |
61 | it isn't.\r |
62 | \r |
63 | uuid_maker\r |
64 | Returns the current UUIDMaker instance for the given module.\r |
65 | \r |
66 | my $uuid = __PACKAGE__->uuid_maker->as_string;\r |
67 | \r |
68 | SEE ALSO\r |
69 | DBIx::Class::UUIDColumns::UUIDMaker\r |
70 | \r |
71 | AUTHOR\r |
72 | Chia-liang Kao <clkao@clkao.org>\r |
73 | \r |
74 | CONTRIBUTERS\r |
75 | Chris Laco <claco@chrislaco.com>\r |
76 | \r |
77 | LICENSE\r |
78 | You may distribute this code under the same terms as Perl itself.\r |
79 | \r |