The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBIx::Skinny::ProxyTable -

SYNOPSIS

  package Proj::DB;
  use DBIx::Skinny;
  use DBIx::Skinny::Mixin modules => [qw(ProxyTable)];

  package Proj::DB::Schema;
  use DBIx::Skinny::Schema;
  use DBIx::Skinny::Schema::ProxyTableRule;

  install_table 'access_log' => shcema {
    proxy_table_rule 'strftime', 'access_log_%Y%m';

    pk 'id';
    columns qw/id/;
  };

  package main;

  Proj::DB->proxy_table->set(access_log => "access_log_200901");
  Proj::DB->proxy_table->copy_table(access_log => "access_log_200901");
  my $rule = Proj::DB->proxy_table->rule('access_log', DateTime->today);
  $rule->table_name; #=> "access_log_200901"
  $rule->copy_table;

  my $iter = Proj::DB->search($rule->table_name, { foo => 'bar' });

DESCRIPTION

DBIx::Skinny::ProxyTable is DBIx::Skinny::Mixin for partitioning table.

METHOD

set($from, $to)

set schema information for table that name is $to based on $from to your project skinny's schema. I don't recommend to call this method directly because of distributing naming rule.

see also rule method.

copy_table($from, $to)

copy table from $from to $to if it $to is not exist. SQLite and MySQL only support.

rule($from, @args)

create DBIx::Skinny::ProxyTable::Rule object. @args is followed by your project skinny's schema definition.

see also +<DBIx::Skinny::ProxyTable::Rule>

AUTHOR

Keiji Yoshimi <walf443 at gmail dot com>

SEE ALSO

+<DBIx::Skinny>, +<DBIx::Class::ProxyTable>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.