Commit | Line | Data |
24105556 |
1 | =head1 NAME |
2 | |
880a1a0c |
3 | DBIx::Class::Manual::Glossary - Clarification of terms used. |
24105556 |
4 | |
5 | =head1 INTRODUCTION |
6 | |
9e7b9292 |
7 | This document lists various terms used in DBIx::Class and attempts to |
8 | explain them. |
24105556 |
9 | |
92fcfd01 |
10 | =head1 DBIx::Class TERMS |
24105556 |
11 | |
db2b2eb6 |
12 | =head2 DB schema |
13 | |
14 | Refers to a single physical schema within an RDBMS. Synonymous with the terms |
15 | 'database', for MySQL; and 'schema', for most other RDBMS(s). |
16 | |
17 | In other words, it's the 'xyz' _thing_ you're connecting to when using any of |
18 | the following L<DSN|DBI/connect>(s): |
19 | |
20 | dbi:DriverName:xyz@hostname:port |
21 | dbi:DriverName:database=xyz;host=hostname;port=port |
22 | |
9e7b9292 |
23 | =head2 Inflation |
24 | |
25 | The act of turning database row data into objects in |
92fcfd01 |
26 | language-space. DBIx::Class result classes can be set up to inflate |
27 | your data into perl objects which more usefully represent their |
28 | contents. For example: L<DBIx::Class::InflateColumn::DateTime> for |
29 | datetime or timestamp column data. |
9e7b9292 |
30 | |
92fcfd01 |
31 | See also L<DBIx::Class::InflateColumn>. |
9e7b9292 |
32 | |
92fcfd01 |
33 | =head2 Deflation |
9e7b9292 |
34 | |
92fcfd01 |
35 | The opposite of L</Inflation>. Existing perl objects that represent |
36 | column values can be passed to DBIx::Class methods to store into the |
37 | database. For example a L<DateTime> object can be automatically |
38 | deflated into a datetime string for insertion. |
9e7b9292 |
39 | |
92fcfd01 |
40 | See L<DBIx::Class::InflateColumn> and other modules in that namespace. |
9e7b9292 |
41 | |
24105556 |
42 | =head2 ORM |
43 | |
9e7b9292 |
44 | Object-relational mapping, or Object-relationship modelling. Either |
45 | way it's a method of mapping the contents of database tables (rows), |
46 | to objects in programming-language-space. DBIx::Class is an ORM. |
47 | |
7cf4ae7a |
48 | =head2 Relationship |
49 | |
50 | In DBIx::Class a relationship defines the connection between exactly |
51 | two tables. The relationship condition lists the columns in each table |
52 | that contain the same values. It is used to output an SQL JOIN |
53 | condition between the tables. |
54 | |
55 | =head2 Relationship bridge |
56 | |
57 | A relationship bridge, such as C<many_to_many> defines an accessor to |
92fcfd01 |
58 | retrieve row contents across multiple relationships. |
7cf4ae7a |
59 | |
92fcfd01 |
60 | The difference between a bridge and a relationship is, that the bridge |
61 | cannot be used to C<join> tables in a C<search>, instead its component |
62 | relationships must be used. |
24105556 |
63 | |
92fcfd01 |
64 | =head2 Schema |
24105556 |
65 | |
92fcfd01 |
66 | A Schema object represents your entire table collection, plus the |
67 | connection to the database. You can create one or more schema objects, |
68 | connected to various databases, with various users, using the same set |
69 | of table L</Result class> definitions. |
70 | |
71 | At least one L<DBIx::Class::Schema> class is needed per database. |
72 | |
73 | =head2 Result class |
74 | |
75 | A Result class defines both a source of data (usually one per table), |
76 | and the methods that will be available in the L</Row> objects created |
77 | using that source. |
78 | |
79 | One Result class is needed per data source (table, view, query) used |
80 | in your application, they should inherit from L<DBIx::Class::Core>. |
24105556 |
81 | |
82 | =head2 ResultSource |
83 | |
92fcfd01 |
84 | ResultSource objects represent the source of your data, these are |
85 | sometimes (incorrectly) called table objects. |
86 | |
87 | ResultSources do not need to be directly created, a ResultSource |
88 | instance is created for each L</Result class> in your L</Schema>, by |
89 | the proxied methods C<table> and C<add_columns>. |
24105556 |
90 | |
91 | See also: L<DBIx::Class::ResultSource/METHODS> |
92 | |
92fcfd01 |
93 | =head2 ResultSet |
94 | |
95 | This is an object representing a set of conditions to filter data. It |
96 | can either be an entire table, or the results of a query. The actual |
97 | data is not held in the ResultSet, it is only a description of how to |
98 | fetch the data. |
99 | |
100 | See also: L<DBIx::Class::ResultSet/METHODS> |
101 | |
24105556 |
102 | =head2 Record |
103 | |
104 | See Row. |
105 | |
106 | =head2 Row |
107 | |
108 | Row objects contain your actual data. They are returned from ResultSet objects. |
109 | |
110 | =head2 Object |
111 | |
112 | See Row. |
113 | |
92fcfd01 |
114 | =head2 join |
24105556 |
115 | |
92fcfd01 |
116 | =head2 prefetch |
117 | |
118 | |
119 | =head1 SQL TERMS |
120 | |
121 | =head2 Join |
122 | |
123 | This is an SQL keyword, it is used to link multiple tables in one SQL |
124 | statement. This enables us to fetch data from more than one table at |
125 | once, or filter data based on content in another table, without having |
126 | to issue multiple SQL queries. |
127 | |
128 | =head2 Normalisation |
129 | |
130 | A normalised database is a sane database. Each table contains only |
131 | data belonging to one concept, related tables refer to the key field |
132 | or fields of each other. Some links to webpages about normalisation |
133 | can be found in L<DBIx::Class::Manual::FAQ|the FAQ>. |
134 | |
135 | =head2 Related data |
136 | |
137 | In SQL, related data actually refers to data that are normalised into |
138 | the same table. (Yes. DBIC does mis-use this term). |