},
build_requires => {
'DBD::SQLite' => 1.11,
+ 'SQL::Translator' => 0.07
},
recommends => {
'Data::UUID' => 0,
},
create_makefile_pl => 'passthrough',
create_readme => 1,
- test_files => [ glob('t/*.t')]
+ test_files => [ glob('t/*.t')],
+ add_to_cleanup => ['t/var/*']
);
Module::Build->new(%arguments)->create_build_script;
--- /dev/null
+Build.PL
+Changes
+lib/DBIx/Class/UUIDColumns.pm
+lib/DBIx/Class/UUIDColumns/UUIDMaker.pm
+lib/DBIx/Class/UUIDColumns/UUIDMaker/APR/UUID.pm
+lib/DBIx/Class/UUIDColumns/UUIDMaker/Data/Uniqid.pm
+lib/DBIx/Class/UUIDColumns/UUIDMaker/Data/UUID.pm
+lib/DBIx/Class/UUIDColumns/UUIDMaker/UUID.pm
+lib/DBIx/Class/UUIDColumns/UUIDMaker/Win32/Guidgen.pm
+lib/DBIx/Class/UUIDColumns/UUIDMaker/Win32API/GUID.pm
+Makefile.PL
+MANIFEST This list of files
+MANIFEST.SKIP
+META.yml
+README
+t/02pod.t
+t/03podcoverage.t
+t/04basic.t
+t/05uuid.t
+t/lib/CustomUUIDMaker.pm
+t/lib/UUIDTest.pm
+t/lib/UUIDTest/Schema.pm
+t/lib/UUIDTest/Schema/Test.pm
+t/lib/UUIDTest/Setup.pm
--- /dev/null
+---
+name: DBIx-Class-UUIDColumns
+version: 0.01000
+author: ~
+abstract: Implicit uuid columns
+license: perl
+requires:
+ DBIx::Class: 0.06002
+recommends:
+ APR::UUID: 0
+ Data::UUID: 0
+ UUID: 0
+ Win32::Guidgen: 0
+ Win32API::GUID: 0
+build_requires:
+ DBD::SQLite: 1.11
+ SQL::Translator: 0.07
+provides:
+ DBIx::Class::UUIDColumns:
+ file: lib/DBIx/Class/UUIDColumns.pm
+ version: 0.01000
+ DBIx::Class::UUIDColumns::UUIDMaker:
+ file: lib/DBIx/Class/UUIDColumns/UUIDMaker.pm
+ DBIx::Class::UUIDColumns::UUIDMaker::APR::UUID:
+ file: lib/DBIx/Class/UUIDColumns/UUIDMaker/APR/UUID.pm
+ DBIx::Class::UUIDColumns::UUIDMaker::Data::UUID:
+ file: lib/DBIx/Class/UUIDColumns/UUIDMaker/Data/UUID.pm
+ DBIx::Class::UUIDColumns::UUIDMaker::Data::Uniqid:
+ file: lib/DBIx/Class/UUIDColumns/UUIDMaker/Data/Uniqid.pm
+ DBIx::Class::UUIDColumns::UUIDMaker::UUID:
+ file: lib/DBIx/Class/UUIDColumns/UUIDMaker/UUID.pm
+ DBIx::Class::UUIDColumns::UUIDMaker::Win32::Guidgen:
+ file: lib/DBIx/Class/UUIDColumns/UUIDMaker/Win32/Guidgen.pm
+ DBIx::Class::UUIDColumns::UUIDMaker::Win32API::GUID:
+ file: lib/DBIx/Class/UUIDColumns/UUIDMaker/Win32API/GUID.pm
+generated_by: Module::Build version 0.26
--- /dev/null
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
+
+ unless (eval "use Module::Build::Compat 0.02; 1" ) {
+ print "This module requires Module::Build to install itself.\n";
+
+ require ExtUtils::MakeMaker;
+ my $yn = ExtUtils::MakeMaker::prompt
+ (' Install Module::Build now from CPAN?', 'y');
+
+ unless ($yn =~ /^y/i) {
+ die " *** Cannot install without Module::Build. Exiting ...\n";
+ }
+
+ require Cwd;
+ require File::Spec;
+ require CPAN;
+
+ # Save this 'cause CPAN will chdir all over the place.
+ my $cwd = Cwd::cwd();
+ my $makefile = File::Spec->rel2abs($0);
+
+ CPAN::Shell->install('Module::Build::Compat')
+ or die " *** Cannot install without Module::Build. Exiting ...\n";
+
+ chdir $cwd or die "Cannot chdir() back to $cwd: $!";
+ }
+ eval "use Module::Build::Compat 0.02; 1" or die $@;
+ use lib '_build/lib';
+ Module::Build::Compat->run_build_pl(args => \@ARGV);
+ require Module::Build;
+ Module::Build::Compat->write_makefile(build_class => 'Module::Build');
--- /dev/null
+NAME
+ DBIx::Class::UUIDColumns - Implicit uuid columns
+
+SYNOPSIS
+ In your DBIx::Class table class:
+
+ __PACKAGE__->load_components(qw/UUIDColumns ... Core/);
+ __PACKAGE__->uuid_columns('artist_id');
+
+ Note: The component needs to be loaded *before* Core.
+
+DESCRIPTION
+ This DBIx::Class component resembles the behaviour of Class::DBI::UUID,
+ to make some columns implicitly created as uuid.
+
+ When loaded, "UUIDColumns" will search for a suitable uuid generation
+ module from the following list of supported modules:
+
+ Data::UUID
+ APR::UUID*
+ UUID
+ Win32::Guidgen
+ Win32API::GUID
+
+ If no supporting module can be found, an exception will be thrown.
+
+ *APR::UUID will not be loaded under OpenBSD due to an as yet
+ unidentified XS issue.
+
+ If you would like to use a specific module, you can set "uuid_class":
+
+ __PACKAGE__->uuid_class('::Data::UUID');
+ __PACKAGE__->uuid_class('MyUUIDGenerator');
+
+METHODS
+ get_uuid
+ Returns a uuid string from the current uuid_maker.
+
+ insert
+ Inserts a new uuid string into each column in "uuid_columns".
+
+ uuid_columns
+ Takes a list of columns to be filled with uuids during insert.
+
+ __PACKAGE__->uuid_columns('artist_id');
+
+ uuid_class
+ Takes the name of a UUIDMaker subclass to be used for uuid value
+ generation. This can be a fully qualified class name, or a shortcut name
+ starting with :: that matches one of the available
+ DBIx::Class::UUIDColumns::UUIDMaker subclasses:
+
+ __PACKAGE__->uuid_class('CustomUUIDGenerator');
+ # loads CustomeUUIDGenerator
+
+ __PACKAGE__->uuid_class('::Data::UUID');
+ # loads DBIx::Class::UUIDMaker::Data::UUID;
+
+ Note that "uuid_class" chacks to see that the specified class isa
+ DBIx::Class::UUIDColumns::UUIDMaker subbclass and throws and exception
+ if it isn't.
+
+ uuid_maker
+ Returns the current UUIDMaker instance for the given module.
+
+ my $uuid = __PACKAGE__->uuid_maker->as_string;
+
+SEE ALSO
+ DBIx::Class::UUIDColumns::UUIDMaker
+
+AUTHORS
+ Chia-liang Kao <clkao@clkao.org> Chris Laco <claco@chrislaco.com>
+
+LICENSE
+ You may distribute this code under the same terms as Perl itself.
+
=head1 METHODS
+=head2 get_uuid
+
+Returns a uuid string from the current uuid_maker.
+
+=head2 insert
+
+Inserts a new uuid string into each column in L</uuid_columns>.
+
=head2 uuid_columns
Takes a list of columns to be filled with uuids during insert.
Returns the new uuid as a string.
+=head2 new
+
+Returns a new uuid maker subclass.
+
=head1 SEE ALSO
L<DBIx::Class::UUIDColumns>,
use Test::More;
BEGIN {
- plan eval "require Data::UUID" ||
- eval "require APR::UUID" ||
- eval "require UUID" ||
- eval "require Win32::Guidgen" ||
- eval "require Win32API::GUID"
- ? ( tests => 3 )
- : ( skip_all => 'needs Data::UUID for testing' );
+ plan skip_all => 'needs Data::UUID for testing'
+ unless
+ eval 'require Data::UUID' ||
+ eval 'require APR::UUID' ||
+ eval 'require UUID' ||
+ eval 'require Win32::Guidgen' ||
+ eval 'require Win32API::GUID';
+
+ plan skip_all => 'needs SQL::Translator for testing'
+ unless eval 'require SQL::Translator';
+
+ plan tests => 3;
}
use lib qw(t/lib);
$row = $schema->resultset('Test')->create({ });
ok UUIDTest::is_uuid( $row->id ), 'got something that loks like a UUID from Data::UUID';
-1;
\ No newline at end of file
+1;