Benjamin Tietz > User-Config-DB-DBIC-0.01_01 > User::Config::DB::DBIC

Download:
User-Config-DB-DBIC-0.01_01.tar.gz

Dependencies

Annotate this POD

Module Version: 0.01_01   Source  

NAME ^

User::Config::DB::DBIC - Use an DBIx::Class schema to store the user-configuration data.

SYNOPSIS ^

  use User::Config;

  my $uc = User::Config->instance;
  $uc->db("DBIC",  {
        schema => "My::DBIC::Schema",
        db => "dbi:SQLite:user.sqlite",
        resultset => "Configuration",
  });

This assumes you want the resultset My::DBIX::Schema::ResultSet::Confiuration to store your options.

DESCRIPTION ^

This is a database-backend for User::Config. How the options get stored in which table will be defined using a DBIx::Class schema and some optional helper-routines.

ATTRIBUTES

All attributes are read-only and should be given at the time of initialization.

db

This attribute contains a DBI-string to connect to the database. Its presence is mandatory.

schema

This contains the name of the schema used to interact with the database. Mandatory.

resultset

The name of the resultset within the schema to use. Mandatory.

usercol

The name of the primary key to use for filtering for a certain user. Optional. Default: "uid"

db_user and db_pwd

These optional attributes will contain the username and password needed to connect to the database.

METHODS

<$db-set($package, $user, $option_name, $context, $value)>>

assigns the value for the given user to the option within a package. See User::Config::DB

<$db-get($package, $user, $option_name, $context)>>

returns the set value. See User::Config::DB

SEE ALSO ^

User::Config DBIx::Class User::Config::DB

AUTHOR ^

Benjamin Tietz <benjamin@micronet24.de>

COPYRIGHT AND LICENSE ^

Copyright (C) 2011 by Benjamin Tietz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: