NAME
SimpleDB::Class::Types - Attribute types.
VERSION
version 1.0103
DESCRIPTION
The allowable value types for SimpleDB::Class::Item attributes.
SYNOPSIS
Type | Default | Range
-----------------------+----------------+-----------------------------------------------
Str | '' | 0 to 1024 characters
MediumStr | '' | 0 to 259,080 chracters
ArrayRefOfStr | [] | 254 Str elements
Int | 0 | -999,999,999 to 99,999,999,999,999 (no commas)
ArrayRefOfInt | [] | 254 Int elements
DateTime | now() | Any DateTime object
ArrayRefOfDateTime | [] | 254 DateTime elements
HashRef | {} | Less than 259,080 characters when converted to JSON
TYPES
The following types may be used to define attributes in SimpleDB::Class::Items.
Str
A string of less than 1024 characters. Defaults to ''
. The basic working unit of SimpleDB. This is the fastest type as it needs no coercion, and is the native storage unit for SimpleDB. When in dobut, use this.
ArrayRefOfStr
An array reference of strings which can have up to 254 elements. Each string follows the rules of Str
. This is your basic multi-value workhorse, as it is the fastest multi-value type.
MediumStr
A string of up to 259,080 characters. Defaults to ''
. Use this only if you need to store text larger than Str
will allow. Much slower than Str
and not reliably searchable or sortable.
Int
An integer between -999,999 and 99,999,999,999,999 (without the commas). Defaults to 0
. Is completely searchable and sortable.
ArrayRefOfInt
An array reference of integers which can have up to 254 elements. Each integer follows the rules of Int
. If you need a multi-value integer type, this is the way to go.
DateTime
A DateTime object. Defaults to:
DateTime->now();
Store a precise date in the database. Is searchable and sortable.
ArrayRefOfDateTime
An array reference of dates which can have up to 254 elements. Each date follows the rules of DateTime
. Use this if you need a multi-value date.
HashRef
A hash reference. For storage this is serialized into JSON and stored as a MediumStr
, therefore it cannot exceed 259,080 characters after serialization. You cannot use it to store a blessed hash reference. It is not searchable, not sortable, and is the slowest field type available. However, it can be quite useful if you need to persist a hash reference.
LEGAL
SimpleDB::Class is Copyright 2009-2010 Plain Black Corporation (http://www.plainblack.com/) and is licensed under the same terms as Perl itself.