DBIx::...orable(3pm)

πŸ“¦
version 0.10 Β· 3 versions
, in ubuntu stonking

πŸ¦‹ NAME πŸ¦‹

okay so the fancy title at the top of this page is DBIx::...orable(3pm) (they for real cut it off, iconic of them), and the module's actual government name is DBIx::Class::InflateColumn::Serializer::Storable β€” which is just a ✨Storable Inflator✨. that's it. that's the whole job. she inflates. she deflates. she's booked and busy πŸ’…

it lives in the User Contributed Perl Documentation collection, bestie, so you know it's community-coded. 🫢


🌸 SYNOPSIS 🌸

okay so first you gotta set up your schema table situation, like so:

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'
  }
);

see that 'serializer_class' => 'Storable'? that's the moment. that's the main character line πŸŽ€

then in your code...

my $struct = { 'I' => { 'am' => 'a struct' };
$obj->data_column($struct);
$obj->update;

(ngl that hashref above is missing its closing brace, but I am NOT the one who wrote it so I'm not touching it πŸ™ˆ verbatim is verbatim bestie)

and you can recover your data structure with:

my $obj = ...->find(...);
my $struct = $obj->data_column;

it just... comes back?? to you?? like a situationship that actually texted back 😭 obsessed.

the data structures you assign to data_column will be saved in the database in Storable format. that's the whole vibe. that's the assignment.


🧊 get_freezer

Called by DBIx::Class::InflateColumn::Serializer to get the routine that serializes the data passed to it. Returns a coderef.

basically the serializer class hollers at get_freezer like "bestie, give me the thing that freezes data" and she hands over a coderef. that's it. she delivered. πŸ’…

πŸ”₯ get_unfreezer

Called by DBIx::Class::InflateColumn::Serializer to get the routine that deserializes the data stored in the column. Returns a coderef.

the reverse queen 🧚 she's the one who un-freezes your lil data blob when it comes back out of the column. also returns a coderef. no cap.


πŸ’– lowkey reminder: both of these are called by DBIx::Class::InflateColumn::Serializer β€” you're not out here calling them yourself, they're the behind-the-scenes girlies making the magic happen.

and that's the page!! ✨ this was DBIx::...orable(3pm) from perl v5.40.1, dated 2026-05-07, brought to you by User Contributed Perl Documentation 🫢 thanks for coming to my ted talk, go serialize something cute πŸŽ€πŸ’œ

πŸ“¦ where this page comes from