Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tangram::type::dump::storable(3pm) [debian man page]

Tangram::Type::Dump::Storable(3pm)			User Contributed Perl Documentation			Tangram::Type::Dump::Storable(3pm)

NAME
Tangram::Type::Dump::Storable - map any Perl object as scalar dump via Storable 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 Tan- gram::Type::Dump::flatten() 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: * col * sql * indent * terse * 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> perl v5.8.8 2006-03-29 Tangram::Type::Dump::Storable(3pm)

Check Out this Related Man Page

Tangram::Type::Hash::Scalar(3pm)			User Contributed Perl Documentation			  Tangram::Type::Hash::Scalar(3pm)

NAME
Tangram::Type/Hash/Scalar - map Perl hash of scalar keys and values SYNOPSIS
use Tangram::Core; use Tangram::Type/Hash/Scalar; # always $schema = Tangram::Schema->new( classes => { NaturalPerson => { fields => { flat_hash => { opinions => { table => 'NP_ops', key_sql => 'VARCHAR(10)', type => 'int', sql => 'NUMERIC(1)', }, lucky_numbers => 'int', # use defaults } DESCRIPTION
Maps references to a Perl hash. The persistent fields are grouped in a hash under the "flat_hash" key in the field hash. The hash may contain as keys and values only 'simple' scalars like integers, strings or real numbers. It may not contain references. For hashs of objects, see Tangram::Type::Hash::FromMany and Tangram::Type::Hash::FromOne. Tangram uses a table to save the state of the collection. The table has three columns, which contain * the id of the container object * the key of the element in the hash * the value of the element 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: * key_type * key_sql * type * sql * table The optional fields "key_type" and "type" specify the key and value types of the hash. If the type is "string" Tangram quotes the values as they are passed to the database. Not specifying a "type" is exactly equivalent to specifying "string". Optional field "table" sets the name of the table that contains the elements. This defaults to 'C_F', where C is the class of the contain- ing object and F is the field name. The optional fields "key_sql" and "sql" specify the type that deploy() (see Tangram::Deploy) should use for the column containing the key and value of the hash. If this field is not present, the SQL type is derived from the "type" field: if "type" is "string" (or is absent) VARCHAR(255) is used; otherwise, the "type" field is interpreted as a SQL type. If the descriptor is a string, it is interpreted as the value of the "type" field and all the other fields take the default value. AUTHOR
This mapping was contributed by Gabor Herr <herr@iti.informatik.tu-darmstadt.de> perl v5.8.8 2006-03-29 Tangram::Type::Hash::Scalar(3pm)
Man Page