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

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');

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

__PACKAGE__->random_string_column(COLUMN_NAME, LENGTH, REGEXP);
REGEXP only support 'Character classes', likes '[A-Z]'. Please note REGEXP is an string.

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.

