


Plagger::Plugin:U:sSeurbsCcornitprtiibouPntl:ea:dgDgBPeIer(r:3l:pP)Dloucguimne:n:tSautbisocnription::DBI(3p)


NNAAMMEE
       Plagger::Plugin::Subscription::DBI - Subscription in database

SSYYNNOOPPSSIISS
           - module: Subscription::DBI
             config:
               schema_class: 'My::Schema'
               connect_info: ['dbi:SQLite:/path/to/plagger.db']

DDEESSCCRRIIPPTTIIOONN
       This plugin allows you to configure your subscription in a database.

       You will need the following:

   SSQQLL
           CREATE TABLE feed (
               id INTEGER NOT NULL PRIMARY KEY,
               url TEXT,
               link TEXT,
               title TEXT
           );

           CREATE TABLE tag (
               id INTEGER NOT NULL PRIMARY KEY,
               name TEXT NOT NULL
           );

           CREATE TABLE feed_tag_map (
               feed INTEGER NOT NULL,
               tag INTEGER NOT NULL,
               PRIMARY KEY (feed, tag)
           );

       and the following DBIx::Class::Schema

   MMyy::::SScchheemmaa
           package My::Schema;
           use strict;
           use warnings;
           use base qw/DBIx::Class::Schema/;

           __PACKAGE__->load_classes();

           1;

   MMyy::::SScchheemmaa::::FFeeeedd
           package My::Schema::Feed;
           use strict;
           use warnings;
           use base qw/DBIx::Class/;

           __PACKAGE__->load_components(qw/Core/);

           __PACKAGE__->table('feed');



perl v5.12.2                2006-12-05                          1





Plagger::Plugin:U:sSeurbsCcornitprtiibouPntl:ea:dgDgBPeIer(r:3l:pP)Dloucguimne:n:tSautbisocnription::DBI(3p)


           __PACKAGE__->add_columns(qw(
                   id
                   url
                   link
                   title
           ));
           __PACKAGE__->set_primary_key(qw/id/);

           1;

   MMyy::::SScchheemmaa::::FFeeeeddTTaaggMMaapp
           package My::Schema::FeedTagMap;

           use strict;
           use warnings;
           use base qw/DBIx::Class/;

           __PACKAGE__->load_components(qw/Core/);

           __PACKAGE__->table('feed_tag_map');
           __PACKAGE__->add_columns(qw(
                   feed
                   tag
           ));

           __PACKAGE__->set_primary_key(qw/feed tag/);

           __PACKAGE__->belongs_to( feed => 'TEST::Schema::Feed' );
           __PACKAGE__->belongs_to( tag  => 'TEST::Schema::Tag' );

           1;

   MMyy::::SScchheemmaa::::TTaagg
           package TEST::Schema::Tag;
           use strict;
           use warnings;
           use base qw/DBIx::Class/;

           __PACKAGE__->load_components(qw/Core/);

           __PACKAGE__->table('tag');
           __PACKAGE__->add_columns(qw(
                   id
                   name
           ));
           __PACKAGE__->set_primary_key(qw/id/);

           __PACKAGE__->has_many( feed_tag_map => 'TEST::Schema::FeedTagMap', 'tag' );
           __PACKAGE__->many_to_many( feeds => feed_tag_map => 'feed' );

           1;

AAUUTTHHOORR
       Franck Cuny



perl v5.12.2                2006-12-05                          2





Plagger::Plugin:U:sSeurbsCcornitprtiibouPntl:ea:dgDgBPeIer(r:3l:pP)Dloucguimne:n:tSautbisocnription::DBI(3p)


       Based on the plugin Plagger::Plugin::Subscription::Config by Tatsuhiko
       Miyagawa

       The schema is inspired by the work of Daisuke Murase for
       Plagger::Plugin::Store::DBIC

SSEEEE AALLSSOO
       Plagger

















































perl v5.12.2                2006-12-05                          3


