The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 75:

You forgot a '=back' before '=head1'