MATSUNO★Tokuhiro > Class-DBI-Plugin-RandomStringColumn-0.05 > Class::DBI::Plugin::RandomStringColumn

Download:
Class-DBI-Plugin-RandomStringColumn-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.05   Source  

NAME ^

Class::DBI::Plugin::RandomStringColumn - Random string column generator for Class::DBI

SYNOPSIS ^

  package Foo;
  use base qw(Class::DBI);
  use Class::DBI::Plugin::RandomStringColumn;
  __PACKAGE__->set_db(('Main', "dbi:SQLite:dbname=db/foo.sqlite", '', '', { AutoCommit => 1 });
  __PACKAGE__->table('foo');
  __PACKAGE__->columns(Primary => qw(session_id));
  __PACKAGE__->columns(All     => qw(number rand_id session_id));
  __PACKAGE__->random_string_column('rand_id', 3, '[0-9]');
  __PACKAGE__->random_string_column('session_id');

DESCRIPTION ^

Class::DBI::Plugin::RandomStringColumn is a plugin for Class::DBI, which generates random string column on create.

METHODS ^

random_string_column
  __PACKAGE__->random_string_column(COLUMN_NAME, LENGTH, REGEXP);

REGEXP only support 'Character classes', likes '[A-Z]'. Please note REGEXP is an string.

AUTHOR ^

MATSUNO Tokuhiro <tokuhiro at mobilefactory.jp>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

DEPENDENCIES ^

String::Random

SEE ALSO ^

Class::DBI