SYNOPSIS

See Tangram::Tour

DESCRIPTION

Tangram is an object-relational mapper. It is orthogonal, meaning that it does not require anything of the objects stored in it (other than the common convention that base objects be based upon HASHes; individual columns can be anything).

It consists of a schema language that can describe or be built around an object structure, or so as to closely match an existing \s-1SQL\s0 schema (with some limitations). This schema language is rich enough to express such common \s-1RDBMS\s0 features as links, foreign keys, and link tables.

It also consists of a relational database storage engine, which based on the schema structure, will make Perl structures persist in a relational (\s-1SQL\s0 compliant) database. References to other objects (or collections, as represented with foreign keys and link tables) may be loaded using on demand references that `lazily' load data when it is needed.

As of Tangram 2.08, the schema need not describe every single object property, so that you can map only the columns you intend to query. The rest of the object is then stored in a column via a serialiser, like Data::Dumper, \s-1YAML\s0 or Storable. These structures themselves may contain arbitrary references to other objects in storage.

Tangram has soundly engineered transaction support, without sacrificing excellent data caching abilities. The general optimisation strategy of the code makes it most suited for \s-1OLTP\s0 (aka application servers) and other situations where it is better to select and update whole rows than to worry about which columns to retrieve/update or not retrieve/update.

Once your object are persistent, you can build query expressions to find them in terms of the schema language that you used to put them in. Therefore, the schema data structure does not describe a data structure, it describes a data access pattern.

If you are not picky about which accessor module to use, preferring to specify the schema once only, then you can use the separately distributed Class::Tangram::Generator to make a set of classes from a Tangram schema structure.

If you are looking for a tool that implements \s-1SQL\s0 abstraction only, you have probably missed the point (of this module, anyway), and a well-supported module like Class::DBI, or an interactive \s-1SQL\s0 modeller like Alzabo will likely suit your needs better.

Tangram is beginning to include preliminary support for aggregation functions, and currently supports grouping, summing and counting. Joins must currently be in terms of integer primary key columns, to extend past this would require extra mapping types to be developed. Basic support for alternative join types is present, but in its infancy.

Tangram currently contains no support for database-side updates (ie, \*(C`UPDATE foo SET bar = 'baz' where frop = 'blarg'\*(C'), but support is planned.

There is no support for creating views based on existing classes to make new derived classes; you have to use your database \s-1SQL\s0 and create corresponding Tangram classes manually to do that.

Tangram has a web site at <http://tangram.utsl.gen.nz/>, currently sponsored by MarketView (New Zealand) Ltd.

DOCUMENTATION INDEX

CONTENTS

Tangram::Tour

The original \*(L"Guided Tour\*(R" of the features of Tangram, by Jean-Louis LeRoy.

Tangram::Intro

The humble beginnings of a new guided tour, based on the next-generation features found in Tangram 2.08.

Tangram::Springfield

The classes and schema used in the Guided Tour(s).

Tangram::Storage

The main database handle class. Includes details on query syntax.

Tangram::Cursor

Return an iterator that retrieves persistent objects in a result set one by one.

Tangram::Schema

The Tangram schema structure - representing your data model so that Tangram can map it.

Tangram::Relational::Mappings

An informative text on exactly how Object Relational Mapping is accomplished by the Tangram::Relational back-end, what the different styles of mapping are, and how each is selected.

Tangram::Type

What Tangram types are available. This page is an index of other manual pages that express the data and relationship types available in Tangram.

Tangram::Type::Extending

How to write your own custom types for Tangram.

Tangram::Dialect

Database-specific extensions to Tangram, such as Tangram::mysql and Tangram::Sybase. These extensions only add functionality, and are not required for core operation of Tangram.

COMPATIBILITY

Tangram has been known to run in the following environments, however, Tangram uses standard \s-1SQL\s0 and should be usable with any \s-1SQL-83\s0 compliant database. Most of the requirements are simply avoiding the worst bugs.

Note that some functions (e.g. transactions and subselects) may not be available in some environments. This is reported during the test suite.

  • Perl 5.005_03+, 5.6.1+, 5.8.1+ (5.8.0 had a nasty bug and doesn't work with Tangram)

  • Set::Object 1.04 (though the latest version is highly recommended)

  • \s-1DBI\s0 1.14

  • DBD::mysql 2.0402

  • DBD::Oracle 1.06

  • DBD::Sybase 0.21

  • DBD::SQLite 1.07

  • DBD::Pg 0.93

LICENSE & WARRANTY

You may use Tangram, free of charge, under the terms of the \s-1GPL\s0. This notice applies to the entire distribution and all of its parts.

You can obtain a commercial license for old (2.04 and earlier) versions of Tangram from Sound Object Logic, see http://www.soundobjectlogic.com/tangram/licenses.html.

\s-1TANGRAM\s0 \s-1COMES\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0 \s-1OF\s0 \s-1ANY\s0 \s-1KIND\s0. \s-1IT\s0 \s-1DOES\s0 \s-1NOT\s0 \s-1EVEN\s0 \s-1COME\s0 \s-1WITH\s0 \s-1ANY\s0 \s-1KIND\s0 \s-1OF\s0 \s-1VAGUE\s0 \s-1IMPLICATION\s0 \s-1THAT\s0 \s-1IT\s0 \s-1DOES\s0 \s-1ANYTHING\s0 \s-1MORE\s0 \s-1THAN\s0 \s-1GIVE\s0 \s-1YOUR\s0 \s-1COMPUTER\s0 \s-1HINTS\s0 \s-1ABOUT\s0 \s-1HOW\s0 \s-1TO\s0 \s-1TRY\s0 \s-1STIRRING\s0 \s-1ITS\s0 \s-1ELECTRONS\s0. \s-1THE\s0 \s-1AUTHORS\s0 \s-1ARE\s0 \s-1NOT\s0 \s-1RESPONSIBLE\s0 \s-1FOR\s0 \s-1THE\s0 \s-1RESULTANT\s0 \s-1ELECTRON\s0 \s-1CONFIGURATION\s0 \s-1IN\s0 \s-1ANY\s0 \s-1WAY\s0 \s-1INCLUDING\s0 \s-1TRANSMUTATIONS\s0 \s-1OF\s0 \s-1ELECTRONS\s0 \s-1INTO\s0 \s-1OTHER\s0 \s-1FIELDS\s0 \s-1SUCH\s0 \s-1AS\s0 \s-1MAGNETIC\s0 \s-1MEDIA\s0 \s-1OR\s0 \s-1PUNCH\s0 \s-1CARDS\s0.

SUPPORT

Please send bug reports directly to the Tangram 2 maintainer's mailing list <[email protected]>, and please \s-1CC:\s0 <[email protected]> so your fault can be tracked accurately.

Whenever possible, include a short yet complete script demonstrating the problem. (read: if you want it fixed quicker, demonstrate it)

Questions of general interest should should be posted to the mailing list, but not sent to rt.cpan.org.

AUTHORS

All the code and documentation for versions 2.04 and earlier, as well as some changes in the 2.05 release, were written by Jean-Louis Leroy ([email protected]) and Sound Object Logic.

Sam Vilain <[email protected]> is the author of the derived work that is Tangram 2.05 and later.

Andres Kievsky <[email protected]> has contributed to the Tangram code starting with Tangram 2.08.