Query: jifty::dbi::filter::yaml
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Jifty::DBI::Filter::YAML(3pm) User Contributed Perl Documentation Jifty::DBI::Filter::YAML(3pm)NAMEJifty::DBI::Filter::YAML - This filter stores arbitrary Perl via YAMLSYNOPSISuse Jifty::DBI::Record schema { column my_data => type is 'text', filters are qw/ Jifty::DBI::Filter::YAML /; }; my $thing = __PACKAGE__->new; $thing->create( my_data => { foo => 'bar', baz => [ 1, 2, 3 ] } ); my $my_data = $thing->my_data; while (my ($key, $value) = %$my_data) { # do something... }DESCRIPTIONThis filter provides the ability to store arbitrary data structures into a database column using YAML. This is very similar to the Jifty::DBI::Filter::Storable filter except that the YAML format remains human-readable in the database. You can store virtually any Perl data, scalar, hash, array, or object into the database using this filter. In addition, YAML (at least the storage of scalars, hashes, and arrays) is compatible with data structures written in other languages, so you may store or read data between applications written in different languages.METHODSencode This method is used to encode the Perl data structure into YAML formatted text. decode This method is used to decode the YAML formatted text from the database into the Perl data structure.IMPLEMENTATIONThis class will attempt to use YAML::Syck if it is available and then fall back upon YAML. This has been done because the Syck library is written in C and is considerably faster.SEE ALSOJifty::DBI::Filter, YAML, YAML::SyckAUTHORAndrew Sterling Hanenkamp <hanenkamp@cpan.org>LICENSEThis program is free software and may be modified or distributed under the same terms as Perl itself. perl v5.14.2 2010-09-21 Jifty::DBI::Filter::YAML(3pm)