Tangra...p::YAML(3pm)

πŸ“¦
version 2.12 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Tangram::Type::Dump::YAML β€” bestie, this one serialises the fields of an object into a column via YAML ✨


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the whole vibe, copy it, don't fight it:

use Tangram::Core;
use Tangram::Type::Dump::YAML;

$schema = Tangram::Schema->new(
   classes => { NaturalPerson => { fields => {

   yaml =>
   {
      diary => # diary is a perl hash
      {
         col => 'diarydata',
         sql => 'TEXT', # better be large enough!  :)

         # YAML dumper control, values here are defaults
         options => {
             Indent => 2,
             UseHeader => 1,
             UseVersion => 1,
             SortKeys => 1,
             UseCode => 0,
             # ... etc, see the YAML man page for more
         },

   }

   }}});

like… read the comments in there, they're doing the heavy lifting fr fr 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so Tangram::Type::Dump::YAML is basically the twin sister of Tangram::Type::Dump::Perl πŸ‘― the only glow-up is that serialisation happens through YAML and not through Data::Dumper. that's the whole switch-up, no cap πŸ’…

😭 okay real talk though: this is currently untested, and it is known to have bugs β€” mostly because YAML literally cannot serialise blessed references (see <http://rt.cpan.org/NoAuth/Bug.html?id=4784>). so like… she's iconic but she's feral. handle with care bestie πŸ’€

that's the whole page pookie 🌸 this was perl v5.36.0, dated 2022-10-16, from the Tangra...p::YAML(3pm) manual, User Contributed Perl Documentation energy the whole way through ✨ mwah, go forth and serialise responsibly πŸ‘‘

πŸ“¦ where this page comes from