The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
=head1 NAME

Tangram::DateTime - map date & time fields

=head1 SYNOPSIS

   use Tangram;

   # any of:
   use Tangram::RawDate;
   use Tangram::RawTime;
   use Tangram::RawDateTime;
   use Tangram::DMDateTime;

   Tangram::Schema->new(
      classes => { NaturalPerson => { fields => {
         rawdatetime => [ qw( birth death ) ],
         rawdate => [ qw( depart return ) ],
         rawtime => [ qw( breakfast lunch dinner ) ],
         dmdatetime => [ qw( attack retreat ) ],


=head1 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 C<use> directive.

The three typetags C<rawdate>, C<rawtime> and C<rawdatetime> are for
mapping strings to SQL date/time types. 'Raw' means that Tangram
doesn't attempt to interpret the strings, it merely passes them down
to DBI.

C<dmdatetime> is like C<rawdatetime> except that the date is converted
to the Date::Manip internal format. This mapping was contributed by Gabor Herr
<herr@iti.informatik.tu-darmstadt.de>.

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:

=over 4

=item * col

=item * sql

=back

C<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. Override if the field name is not an acceptable SQL column name.

C<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.