KiokuDB/Role/UUIDs/SerialIDs.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 92.3% 12 / 13 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
generate_uuid
1.0
CRAP 1.0
« KiokuDB/Role/ID/Digest.pm ↑ Summary KiokuDB/TypeMap/Entry/Std/ID.pm »
1 #!/usr/bin/perl
2  
3 package KiokuDB::Role::UUIDs::SerialIDs;
4 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 my $i = "0001"; # so that the first 10k objects sort lexically
9 51 ▶sub generate_uuid { $i++ }
Subroutine generate_uuid: called CC=1 SCAR=0.0
Pod undocumented
10  
11 2 __PACKAGE__
12  
13 __END__
14  
15 =pod
16  
17 =head1 NAME
18  
19 KiokuDB::Role::UUIDs::SerialIDs - Serial ID assignment based on a global
20 counter.
21  
22 =head1 SYNOPSIS
23  
24 # set before loading:
25  
26 BEGIN { $KiokuDB::SERIAL_IDS = 1 }
27  
28 use KiokuDB;
29  
30 =head1 DESCRIPTION
31  
32 This role provides an alternate, development only ID generation role.
33  
34 The purpose of this role is to ease testing when the database is created from
35 scratch on each run. Objects will typically be assigned the same IDs between
36 runs, making things easier to follow.
37  
38 Do B<NOT> use this role for storage of actual data, because ID clashes are
39 almost guaranteed to cause data loss.
40  
41 =cut
« KiokuDB/Role/ID/Digest.pm ↑ Summary KiokuDB/TypeMap/Entry/Std/ID.pm »