DBIx::...::YAML(3pm)
π DBIx::...::YAML π
okay bestie, so the full name of this one is DBIx::Class::InflateColumn::Serializer::YAML and it's literally a YAML Inflator. it lives in the User Contributed Perl Documentation corner of your system, under the name DBIx::...::YAML(3pm). she's a tiny lil module but she's doing the lord's work π«Ά
β¨ SYNOPSIS β¨
first you gotta tell your schema that this column is a YAML column, 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' => 'YAML'
}
);
Then in your code...
my $struct = { 'I' => { 'am' => 'a struct' };
$obj->data_column($struct);
$obj->update;
and yes we copy that line exactly as written, no notes π
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 YAML format. that's the whole plot. she takes your pretty perl hashref, turns it into YAML text, and drops it in the column. then she pulls it back out and hands you a hashref again. iconique. πΈ
π§ get_freezer
Called by DBIx::Class::InflateColumn::Serializer to get the routine that serializes the data passed to it. Returns a coderef. β¨
π get_unfreezer
Called by DBIx::Class::InflateColumn::Serializer to get the routine that deserializes the data stored in the column. Returns a coderef. π¦
π lowkey reminder: both of these are the hooks that DBIx::Class::InflateColumn::Serializer calls for you β you're not meant to be out here summoning them yourself, they're the plumbing behind the scenes, iykyk.
and that's the whole page, bestie π this is perl v5.40.1, dated 2026-05-07, from DBIx::...::YAML(3pm) β slay, go inflate something πβ¨π
π¦ where this page comes from
- ubuntu stonking: libdbix-class-inflatecolumn-serializer-perl 0.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms