SYNOPSIS

  # ... in a nearby Tangram::Schema structure ...
  SomeClass =>
    { fields =>
      { idbif => {
            -options => { dumper => 'Data::Dumper',
                        },
            some_field => undef,
            some_property => undef,
            some_attribute => undef,
            each_one => undef,
            gets => undef,
            saved => undef,
        },
        string => {
            cheese => undef,
        },
      },
    };

DESCRIPTION

The idbif mapping type collates multiple data members into a single perl_dump (see Tangram::Type::Dump::Perl), storable (see Tangram::Type::Dump::Storable) or yaml (see Tangram::Type::Dump::YAML) column.

For instance, with the schema definition in the example, all the columns in the example would be serialised via Data::Dumper.

If you stored an object like this:

$cheese = bless { cheese => "gouda", gets => 6, each_one => 9 }, "SomeClass";

You would see something in your database similar to:

/^'--v------v--------v----------------------------'^\ | id | type | cheese | idbif | >----o------o--------o------------------------------< | 1 | 42 | gouda | { gets => 6, each_one => 9 } | \_,--^------^--------^----------------------------._/

(note: the actual output from your \s-1SQL\s0 Database client may differ from the above)

So, if you're the sort of person who likes to set their attributes with accessors, but doesn't like the overhead this places on the \s-1RDBMS\s0... then this may help. Note: the real benefits of this mapping type are for when you're storing more complex data structures than \*(L"6\*(R" and \*(L"9\*(R" :-).

You may prefer to use the default dumping type, which is storable.

\s-1LINKS\s0 \s-1TO\s0 \s-1OTHER\s0 \s-1OBJECTS\s0

If Tangram encounters another object which is already in storage (ie, has been inserted via \*(C`$storage->insert($foo)\*(C'), then it will store a \*(L"Memento\*(R". This memento includes the object \s-1ID\s0, which is sensitive to schema changes (the ordering of classes in the schema).

If the class implements a \*(C`px_freeze\*(C' and \*(C`px_thaw\*(C' function, then there will be a \*(L"Memento\*(R" that includes the class name of the object, and the data that was returned by the class' \*(C`px_freeze\*(C' method. To be reconstituted, it is called as:

SomeClass->px_thaw(@data)

See Tangram::Type::Dump for more details on the complicity \s-1API\s0.

Please set \s-1RETVAL\s0 to be the thawed object. (that is, return a single scalar).

\s-1BUT\s0, I \s-1REALLY\s0, \s-1REALLY\s0 \s-1HATE\s0 \s-1SCHEMAS\s0!

However, maybe you are one of those folk who don't like to declare their attributes, instead peppering hashes willy nilly, then there is another option.

Instead of explicitly listing the fields you want, if you don't specify any fields at all, then it means save \s-1ALL\s0 remaining fields into the column. For convenience, \*(C`-poof\*(C' is provided as a synonym for \*(C`-options\*(C', so you can write:

{ fields => { idbif => { -poof => # There goes another one! { }, } }, }

[ You see, Tangram::Type::Dump::Any isn't actually an intuitive \s-1DB\s0 interface. No, an intuitive \s-1DB\s0 interface is a user interface component, and that title is reserved for Visual Tangram. \s-1VT\s0 expects to pick up the title with any luck by the end of the 21st century^W \s-1RSN\s0!

I Don't Believe In Fairies is actually what it stands for. It's a completely arbitrary name; chosen for no reason at all, and certainly not anything to do with Pixie. ]