DBIx::Skinny::ProxyTable - handling dynamic table for DBIx::Skinny
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 'named_strftime', 'access_log_%Y%m', 'accessed_on'; pk 'id'; columns qw/id/; }; package main; my $rule = Proj::DB->proxy_table->rule('access_log', accessed_on => DateTime->today); $rule->table_name; #=> "access_log_200901" $rule->copy_table; my $iter = Proj::DB->search($rule->table_name, { foo => 'bar' }); # or you can call manually. ( NOT RECOMMEND ) Proj::DB->proxy_table->set(access_log => "access_log_200901"); Proj::DB->proxy_table->copy_table(access_log => "access_log_200901");
DBIx::Skinny::ProxyTable is DBIx::Skinny::Mixin for partitioning table.
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 $from to $to if it $to is not exist. SQLite and MySQL only support.
create DBIx::Skinny::ProxyTable::Rule object. @args is followed by your project skinny's schema definition.
see also DBIx::Skinny::ProxyTable::Rule
Keiji Yoshimi <walf443 at gmail dot com>
DBIx::Skinny, DBIx::Class::ProxyTable
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DBIx::Skinny::ProxyTable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Skinny::ProxyTable
CPAN shell
perl -MCPAN -e shell install DBIx::Skinny::ProxyTable
For more information on module installation, please visit the detailed CPAN module installation guide.