Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Tangram::Type::Array::UseraContributed Perl DocTangram::Type::Array::Scalar(3)

NAME
       Tangram::Type::Array::Scalar - map Perl array of	strings	or numbers

SYNOPSIS
	  use Tangram::Core;
	  use Tangram::Type::Array::Scalar; # always

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

	     flat_array	=>
	     {
		interests =>
		{
		   table => 'NP_int',
		   sql => 'VARCHAR(50)',
		},

		lucky_numbers => 'int',	# use defaults
	     }

DESCRIPTION
       Maps references to a Perl array.	The persistent fields are grouped in a
       hash under the "array" key in the field hash.

       The array may contain only 'simple' scalars like	integers, strings or
       real numbers. It	may not	contain	references. For	arrays of objects, see
       Tangram::Type::Array::FromMany and Tangram::Type::Array::FromOne.

       Tangram uses a table to save the	state of the collection. The table has
       three columns, which contain

       o   the id of the container object

       o   the position	of the element in the array

       o   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:

       o   type

       o   table

       o   sql

       Optional	field "type" specifies the type	of the elements. 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
       containing object and F is the field name.

       Optional	field "sql" specifies the type that deploy() (see
       Tangram::Deploy)	should use for the column containing the elements. 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.

perl v5.32.0			  2015-10-09   Tangram::Type::Array::Scalar(3)

NAME | SYNOPSIS | DESCRIPTION

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Tangram::Type::Array::Scalar&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help