| DBIx::Class::InflateColumn::Serializer::Storable(3pm) | User Contributed Perl Documentation | DBIx::Class::InflateColumn::Serializer::Storable(3pm) |
DBIx::Class::InflateColumn::Serializer::Storable - Storable Inflator
package MySchema::Table;
use base 'DBIx::Class';
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
__PACKAGE__->add_columns(
'data_column' => {
'data_type' => 'VARCHAR',
'size' => 255,
'serializer_class' => 'Storable'
}
);
Then in your code...
my $struct = { 'I' => { 'am' => 'a struct' };
$obj->data_column($struct);
$obj->update;
And you can recover your data structure with:
my $obj = ...->find(...); my $struct = $obj->data_column;
The data structures you assign to "data_column" will be saved in the database in Storable format.
| 2022-06-13 | perl v5.34.0 |