DBIx::Class::CompressColumns - Automatic Compression/Decompression of columns
In your DBIx::Class table class:
__PACKAGE__->load_components(qw/CompressColumns ... Core/); __PACKAGE__->compresscolumns( columns => [qw/ column_foo /], auto => 1, );
Note: The component needs to be loaded before Core.
Alternatively you could call each method individually
__PACKAGE__->compress_columns(qw/ column_foo /); __PACKAGE__->compress_auto(1);
This DBIx::Class component can be used to automatically compress and decompress data in selected columns.
__PACKAGE__->compresscolumns( columns => [qw/ column_foo /], auto => 1, );
Takes a list of columns to be compressed/decompressed during insert or retrieval.
__PACKAGE__->compress_columns(qw/ column_foo /);
Handles the actual compression of column values into binary objects. When given a
$value it will return the compressed binary for that value.
Handles the actual decompression of column values into scalar strings. When given a
$value it will return the uncompressed scalar for that compressed binary value.
Go through the columns and compress the values that need it.
This method is called by insert and update when automatic compression is turned on.
Turns on and off automatic compression/decompression of columns. When on, this feature makes all UPDATEs and INSERTs automatically insert a compressed binary into selected columns. SELECTS will retrieve the decompressed scalar from selected columns.
The default is for compress_auto is to be on.
The following DBIx::Class::Row methods are extended by this module:-
Jesse Stay (jessestay) <email@example.com>
A Product of SocialToo.com
You may distribute this code under the same terms as Perl itself.