Jerome Eteve
and 1 contributors

NAME

Schedule::LongSteps::Storage::AutoDBIx - An automatically deployed storage.

DEPENDENCIES

To use this, you will have to add the following dependencies to your dependency manager:

DBIx::Class, SQL::Translator, DBIx::Class::InflateColumn::Serializer, and one of DateTime::Format::* matching your database.

SYNOPSIS

First instantiate a storage with a subroutine returning a valid $dbh (from DBI for instance, or from your own DBIx::Class::Schema)):

  my $storage = Schedule::LongSteps::Storage::AutoDBIx->new({
                     get_dbh => sub{ return a valid $dbh },
                });

Note that this will automatically create a table named 'schedule_longsteps_process' in your database. This is not configurable for now. That also means that building such a storage is slow, so try to do it only once in your application.

Then build and use a Schedule::LongSteps object:

  my $long_steps = Schedule::LongSteps->new({ storage => $storage });

  ...

ATTRIBUTES

get_dbh

A subroutine that returns a valid $dbh (from DBI) database connection handle. Required.

auto_deploy

Set that to false if you dont want this to deploy its built in schema automatically. Defaults to 1.

prepare_due_processes

See Schedule::LongSteps::Storage

create_process

See Schedule::LongSteps::Storage

find_process

See Schedule::LongSteps::Storage

deploy

Deploys this in the given dbh. Use this only ONCE if 'auto_deploy' is false.

Usage:

 $this->deploy();