.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Tangram 3pm" .TH Tangram 3pm "2015-11-09" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Tangram \- Store pure objects in standard relational databases .SH "SYNOPSIS" .IX Header "SYNOPSIS" See Tangram::Tour .SH "DESCRIPTION" .IX Header "DESCRIPTION" Tangram is an \fIobject-relational mapper\fR. It is \fIorthogonal\fR, 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). .PP It consists of a \fIschema language\fR 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. .PP It also consists of a \fIrelational database storage\fR 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 \fIon demand references\fR that `lazily' load data when it is needed. .PP 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. .PP 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. .PP 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 \fIdata access pattern\fR. .PP 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. .PP If you are looking for a tool that implements \fI\s-1SQL\s0 abstraction\fR 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. .PP 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. .PP Tangram currently contains no support for database-side updates (ie, \&\f(CW\*(C`UPDATE foo SET bar = \*(Aqbaz\*(Aq where frop = \*(Aqblarg\*(Aq\*(C'\fR), but support is planned. .PP 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. .PP Tangram has a web site at , currently sponsored by MarketView (New Zealand) Ltd. .SH "DOCUMENTATION INDEX" .IX Header "DOCUMENTATION INDEX" .SH "CONTENTS" .IX Header "CONTENTS" .IP "Tangram::Tour" 4 .IX Item "Tangram::Tour" The original \*(L"Guided Tour\*(R" of the features of Tangram, by Jean-Louis Leroy. .IP "Tangram::Intro" 4 .IX Item "Tangram::Intro" The humble beginnings of a new guided tour, based on the next-generation features found in Tangram 2.08. .IP "Tangram::Springfield" 4 .IX Item "Tangram::Springfield" The classes and schema used in the Guided Tour(s). .IP "Tangram::Storage" 4 .IX Item "Tangram::Storage" The main database handle class. Includes details on query syntax. .IP "Tangram::Cursor" 4 .IX Item "Tangram::Cursor" Return an iterator that retrieves persistent objects in a result set one by one. .IP "Tangram::Schema" 4 .IX Item "Tangram::Schema" The Tangram schema structure \- representing your data model so that Tangram can map it. .IP "Tangram::Relational::Mappings" 4 .IX Item "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. .IP "Tangram::Type" 4 .IX Item "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. .IP "Tangram::Type::Extending" 4 .IX Item "Tangram::Type::Extending" How to write your own custom types for Tangram. .IP "Tangram::Dialect" 4 .IX Item "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. .SH "COMPATIBILITY" .IX Header "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. .PP Note that some functions (e.g. transactions and subselects) may not be available in some environments. This is reported during the test suite. .IP "\(bu" 4 Perl 5.005_03+, 5.6.1+, 5.8.1+ (5.8.0 had a nasty bug and doesn't work with Tangram) .IP "\(bu" 4 Set::Object 1.04 (though the latest version is highly recommended) .IP "\(bu" 4 \&\s-1DBI 1.14\s0 .IP "\(bu" 4 DBD::mysql 2.0402 .IP "\(bu" 4 DBD::Oracle 1.06 .IP "\(bu" 4 DBD::Sybase 0.21 .IP "\(bu" 4 DBD::SQLite 1.07 .IP "\(bu" 4 DBD::Pg 0.93 .SH "LICENSE & WARRANTY" .IX Header "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. .PP 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. .PP \&\s-1TANGRAM COMES WITHOUT ANY WARRANTY OF ANY KIND. IT DOES NOT EVEN COME WITH ANY KIND OF VAGUE IMPLICATION THAT IT DOES ANYTHING MORE THAN GIVE YOUR COMPUTER HINTS ABOUT HOW TO TRY STIRRING ITS ELECTRONS. THE AUTHORS ARE NOT RESPONSIBLE FOR THE RESULTANT ELECTRON CONFIGURATION IN ANY WAY INCLUDING TRANSMUTATIONS OF ELECTRONS INTO OTHER FIELDS SUCH AS MAGNETIC MEDIA OR PUNCH CARDS.\s0 .SH "SUPPORT" .IX Header "SUPPORT" Please send bug reports directly to the Tangram 2 maintainer's mailing list , and please \s-1CC:\s0 so your fault can be tracked accurately. .PP Whenever possible, include a short yet complete script demonstrating the problem. (read: if you want it fixed quicker, demonstrate it) .PP Questions of general interest should should be posted to the mailing list, but not sent to rt.cpan.org. .SH "AUTHORS" .IX Header "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 (jll@soundobjectlogic.com) and Sound Object Logic. .PP Sam Vilain is the author of the derived work that is Tangram 2.05 and later. .PP Andres Kievsky has contributed to the Tangram code starting with Tangram 2.08.