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

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

COPYRIGHT
Copyright (C) 2008, Viacheslav Tykhanovskyi.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl 5.10.