GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TANGRAM::TYPE::DUMP::STORABLE (3)

.ds Aq ’

NAME

Tangram::Type::Dump::Storable - map any Perl object as scalar dump via Storable

CONTENTS

SYNOPSIS



   use Tangram::Core;
   use Tangram::Type::Dump::Storable; # always

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

      storable =>
      {
         diary => # diary is a perl hash
         {
            col => diarydata,
            sql => BLOB,
            indent => 0,
            terse => 1,
            purity => 0
         },

         lucky_numbers => int, # use defaults
      }



DESCRIPTION

Maps arbitrary Perl data structures by serializing to a string representation. The persistent fields are grouped in a hash under the storable key in the field hash.

Serialization is done by Storable::freeze, which traverses the Perl data structure and creates a binary representation of it. The resulting string will be mapped to the DBMS as a scalar value. During restore, the scalar value will be restored with Storable::thaw to reconstruct the original data structure.

The structure should be able to contain pretty much anything that may be safely dumped by Storable. However, be aware that <B>B>Tangram::Type::Dump::flatten()<B>B> must be able to find the persistent objects in the field. Unless you’re using classes that are implemented in C and contain other objects, you should be fine (Set::Object has a special work-around).

The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a string. The hash uses the following fields:
o col
o sql
o indent
o terse
o purity
The optional fields col and sql specify the column name and the column type for the scalar value in the database. If not present, col defaults to the field name and sql defaults to VARCHAR(255). Values will be always quoted as they are passed to the database.

The remaining optional fields control the serialization process. They will be passed down to Data::Dumper as values to the corresponding Data::Dumper options. The default settings are: no indentation (indent=0), compact format (terse=1), and quick dump (purity=0).

AUTHOR

This mapping was contributed by Gabor Herr <herr@iti.informatik.tu-darmstadt.de>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TANGRAM::TYPE::DUMP::STORABLE (3) 2015-10-09

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.