Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

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

Tangram::Type::TimeAndDate(3pm) 			User Contributed Perl Documentation			   Tangram::Type::TimeAndDate(3pm)

NAME
Tangram::Type::TimeAndDate - map date & time fields SYNOPSIS
use Tangram; # any of: use Tangram::Type::Date; # RAW - use with caution use Tangram::Type::Time; use Tangram::Type::Date::Cooked; # pure ISO-8601 use Tangram::Type::Date::DateTime; use Tangram::Type::Date::Manip; use Tangram::Type::Date::TimePiece; Tangram::Schema->new( classes => { NaturalPerson => { fields => { rawdatetime => [ qw( birth death ) ], rawdate => [ qw( depart return ) ], rawtime => [ qw( breakfast lunch dinner ) ], cookeddatetime => [ qw( cooked ) ], dmdatetime => [ qw( datemanip ) ], timepiece => [ qw( fob ) ], datetime => [ qw( bloat ) ], DESCRIPTION
These classes are responsible for mapping strings to SQL date or time types. These classes are not imported by Tangram.pm, thus they must be explicitly imported via a "use" directive. The three typetags "rawdate", "rawtime" and "rawdatetime" are for mapping strings to SQL date/time types, for databases that differentiate between "dates" and "times". 'Raw' means that Tangram doesn't attempt to interpret the strings, it merely passes them down to DBI. "cookeddatetime" is like "rawdatetime" except that the date is converted from the DBMS format to ISO-8601 in the form : YYYY-MM-DDTHH:MM:SS for example: 2004-12-25T13:14:15 Other modules then further cook this ISO date into an object as is the convention for a particular module. This only works with back-ends that allow per-connection settings for the default date format, such as Tangram::Driver::Oracle. On the way back out, the date is converted back to the DBMS format. This is achieved via vendor-specific functions mentioned in "Tan- gram::Relational". The persistent fields may be specified either as a hash or as an array of field names. In the hash form, each entry consists in a field name and an associated option hash. The option hash may contain the following fields: * col * sql "col" sets the name of the column used to store the field's value. This field is optional, it defaults to the persistent field name. Over- ride if the field name is not an acceptable SQL column name. "sql" sets the SQL type of the column. Used by Schema::deploy() when initializing a database. Defaults to 'VARCHAR(255) NULL' for strings, 'INT NULL' for ints and 'REAL NULL' for reals. The persistent fields may also be specified as an array of strings, in which case the defaults are used. perl v5.8.8 2006-03-29 Tangram::Type::TimeAndDate(3pm)

Check Out this Related Man Page

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

NAME
Tangram::Type::Scalar - map scalar fields SYNOPSIS
use Tangram; Tangram::Schema->new( classes => { NaturalPerson => { fields => { string => [ qw( name firstName gender ) ], int => [ qw( age ) ], real => [ qw( height weight ) ], $schema = Tangram::Schema->new( classes => { NaturalPerson => { fields => { string => { name => { sql => 'VARCHAR(100)' }, 1stname => { col => 'firstName', sql => 'VARCHAR(100) NULL' }, gender => undef() }, DESCRIPTION
Classes Tangram::Type::String, ::Int and ::Real and ::Ref are responsible for mapping the various subtypes of scalars. The first three map- pings are documented here since they differ very little. See Tangram::Type::Ref::FromMany for information on mapping references. Tangram::Type::String uses DBI's quote() method to quote strings if that method is available, thus making it possible to store binary objects or multiline text in databases that support it (thanks to Marian Kelc <marian.kelc@ruhr-uni-bochum.de> for suggesting this improve- ment). The three predefined typetags "string", "int" and "real" are for the corresponding Perl scalar subtypes. Each scalar field is stored in a single column of the table associated to the class. The persistent fields may be specified either as a hash or as an array of field names. In the hash form, each entry consists in a field name and an associated option hash. The option hash may contain the following fields: * col * sql * automatic "col" sets the name of the column used to store the field's value. This field is optional, it defaults to the persistent field name. Over- ride if the field name is not an acceptable SQL column name. "sql" sets the SQL type of the column. Used by Schema::deploy() when initializing a database. Defaults to 'VARCHAR(255) NULL' for strings, 'INT NULL' for ints and 'REAL NULL' for reals. "automatic", if set to true, tells Tangram not to save the field to storage. This is useful for auto-increment or timestamp columns. The persistent fields may also be specified as an array of strings, in which case the defaults are used. perl v5.8.8 2006-03-29 Tangram::Type::Scalar(3pm)
Man Page