.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Tangram::Type::Dump::Any 3pm" .TH Tangram::Type::Dump::Any 3pm "2015-10-09" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Tangram::Type::Dump::Any \- Intuitive DataBase InterFace .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 10 \& # ... in a nearby Tangram::Schema structure ... \& SomeClass => \& { fields => \& { idbif => { \& \-options => { dumper => \*(AqData::Dumper\*(Aq, \& }, \& some_field => undef, \& some_property => undef, \& some_attribute => undef, \& each_one => undef, \& gets => undef, \& saved => undef, \& }, \& string => { \& cheese => undef, \& }, \& }, \& }; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \fBidbif\fR mapping type collates multiple data members into a single \&\fBperl_dump\fR (see Tangram::Type::Dump::Perl), \fBstorable\fR (see Tangram::Type::Dump::Storable) or \fByaml\fR (see Tangram::Type::Dump::YAML) column. .PP For instance, with the schema definition in the example, all the columns in the example would be serialised via Data::Dumper. .PP If you stored an object like this: .PP .Vb 3 \& $cheese = bless { cheese => "gouda", \& gets => 6, \& each_one => 9 }, "SomeClass"; .Ve .PP You would see something in your database similar to: .PP .Vb 5 \& /^\*(Aq\-\-v\-\-\-\-\-\-v\-\-\-\-\-\-\-\-v\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq^\e \& | id | type | cheese | idbif | \& >\-\-\-\-o\-\-\-\-\-\-o\-\-\-\-\-\-\-\-o\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-< \& | 1 | 42 | gouda | { gets => 6, each_one => 9 } | \& \e_,\-\-^\-\-\-\-\-\-^\-\-\-\-\-\-\-\-^\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-._/ .Ve .PP (note: the actual output from your \s-1SQL\s0 Database client may differ from the above) .PP 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" :\-). .PP You may prefer to use the default dumping type, which is \fBstorable\fR. .SS "\s-1LINKS TO OTHER OBJECTS\s0" .IX Subsection "LINKS TO OTHER OBJECTS" If Tangram encounters another object which \fBis already in storage\fR (ie, has been inserted via \f(CW\*(C`$storage\->insert($foo)\*(C'\fR), 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). .PP If the class implements a \f(CW\*(C`px_freeze\*(C'\fR and \f(CW\*(C`px_thaw\*(C'\fR 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' \f(CW\*(C`px_freeze\*(C'\fR method. To be reconstituted, it is called as: .PP .Vb 1 \& SomeClass\->px_thaw(@data) .Ve .PP See Tangram::Type::Dump for more details on the complicity \s-1API.\s0 .PP Please set \s-1RETVAL\s0 to be the thawed object. (that is, return a single scalar). .SS "\s-1BUT, I REALLY, REALLY HATE SCHEMAS\s0!" .IX Subsection "BUT, I REALLY, REALLY HATE SCHEMAS!" 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. .PP 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, \f(CW\*(C`\-poof\*(C'\fR is provided as a synonym for \f(CW\*(C`\-options\*(C'\fR, so you can write: .PP .Vb 7 \& { fields => \& { idbif => { \-poof => # There goes another one! \& { \& }, \& } \& }, \& } .Ve .PP [ 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! .PP 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. ]