MojoX::Session::Store::Dbic(3p)

NAME
MojoX::Session::Store::DBIC - DBIx::Class Store for MojoX::Session

SYNOPSIS
    CREATE TABLE session (
        sid          VARCHAR(40) PRIMARY KEY,
        data         TEXT,
        expires      INTEGER UNSIGNED NOT NULL,
        UNIQUE(sid)
    );

    my $schema = DB->connect($dsn, $user, $pass, \%attr);
    my $rs = $schema->resultset('Session');
    my $session = MojoX::Session->new(
        store => MojoX::Session::Store::DBI->new(resultset => $rs),
        ...
    );

DESCRIPTION
MojoX::Session::Store::DBIC is a store for MojoX::Session that stores a session in a database using DBIx::Class.

ATTRIBUTES
MojoX::Session::Store::DBIC implements the following attributes.

  "resultset"
    my $resultset = $store->resultset;
    $resultset    = $store->resultset(resultset);

Get and set DBIx::Class::ResultSet object.

  "sid_column"
Session id column name. Default is 'sid'.

  "expires_column"
Expires column name. Default is 'expires'.

  "data_column"
Data column name. Default is 'data'.

METHODS
MojoX::Session::Store::DBIC inherits all methods from MojoX::Session::Store.

  "create"
Insert session to database.

  "update"
Update session in database.

  "load"
Load session from database.

  "delete"
Delete session from database.

AUTHOR
William Ono