DBIx::Recordset::FileSeq(3pm)

DBIx::Recordset::FileSeq3pm

Sequence generator in filesystem

Usage

 use DBIx::Recordset::FileSeq ;
 $self = DBIx::Recordset::FileSeq (undef, '/tmp/seq', $min, $max) ;
 
 $val1 = $self -> NextVal ('foo') ;
 $val2 = $self -> NextVal ('foo') ;
 $val3 = $self -> NextVal ('bar') ;

Overview

DBIx::Recordset::FileSeq generates unique numbers. State is kept in the filesystem. With the new constructor you specify the directory where the state is kept. (First parameter is a dummy values, that will receive the database handle from DBIx::Recordset, but you don't need it when you use it without DBIx::Recordset). Optionaly you can give a min and a max values, which will be used for new sequences.

With NextVal you can get the next value for the sequence of the given name.

The state if kept by haveing a file with the name

seq.<seqencename>.<max>.<count>

Each time the sequnce value increments the file is renamed. If the <max> if a numeric value the new value is checked against <max> and NextVal dies if the sequnce value increment above max.

Releases

12 releases since Debian 3.0 (Woody); the text changed 5 times.

  1. 3.0
  2. 3.1–5.0
  3. 6.0–8
  4. 9–10
  5. 11
  6. 12–13

Author

G.Richter ([email protected])

From libdbix-recordset-perl 0.26-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.