summaryrefslogtreecommitdiff
path: root/htdocs/docs/man/FS/dbdef_table.html
blob: a2442729f3cbe1bebe05e9808d1fe84c7f386ea7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<HTML>
<HEAD>
<TITLE>FS::dbdef_table - Table objects</TITLE>
<LINK REV="made" HREF="mailto:none">
</HEAD>

<BODY>

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#METHODS">METHODS</A>
	<LI><A HREF="#BUGS">BUGS</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#VERSION">VERSION</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
FS::dbdef_table - Table objects

<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
<PRE>  use FS::dbdef_table;
</PRE>
<P>
<PRE>  $dbdef_table = new FS::dbdef_table (
    &quot;table_name&quot;,
    &quot;primary_key&quot;,
    $FS_dbdef_unique_object,
    $FS_dbdef_index_object,
    @FS_dbdef_column_objects,
  );
</PRE>
<P>
<PRE>  $dbdef_table-&gt;addcolumn ( $FS_dbdef_column_object );
</PRE>
<P>
<PRE>  $table_name = $dbdef_table-&gt;name;
  $dbdef_table-&gt;name (&quot;table_name&quot;);
</PRE>
<P>
<PRE>  $table_name = $dbdef_table-&gt;primary_keye;
  $dbdef_table-&gt;primary_key (&quot;primary_key&quot;);
</PRE>
<P>
<PRE>  $FS_dbdef_unique_object = $dbdef_table-&gt;unique;
  $dbdef_table-&gt;unique ( $FS_dbdef_unique_object );
</PRE>
<P>
<PRE>  $FS_dbdef_index_object = $dbdef_table-&gt;index;
  $dbdef_table-&gt;index ( $FS_dbdef_index_object );
</PRE>
<P>
<PRE>  @column_names = $dbdef-&gt;columns;
</PRE>
<P>
<PRE>  $FS_dbdef_column_object = $dbdef-&gt;column;
</PRE>
<P>
<PRE>  @sql_statements = $dbdef-&gt;sql_create_table;
  @sql_statements = $dbdef-&gt;sql_create_table $datasrc;
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
FS::dbdef_table objects represent a single database table.

<P>
<HR>
<H1><A NAME="METHODS">METHODS</A></H1>
<DL>
<DT><STRONG><A NAME="item_new">new</A></STRONG><DD>
<P>
Creates a new FS::dbdef_table object.

<DT><STRONG><A NAME="item_addcolumn">addcolumn</A></STRONG><DD>
<P>
Adds this FS::dbdef_column object. 

<DT><STRONG><A NAME="item_name">name</A></STRONG><DD>
<P>
Returns or sets the table name.

<DT><STRONG><A NAME="item_primary_key">primary_key</A></STRONG><DD>
<P>
Returns or sets the primary key.

<DT><STRONG><A NAME="item_unique">unique</A></STRONG><DD>
<P>
Returns or sets the FS::dbdef_unique object.

<DT><STRONG><A NAME="item_index">index</A></STRONG><DD>
<P>
Returns or sets the FS::dbdef_index object.

<DT><STRONG><A NAME="item_columns">columns</A></STRONG><DD>
<P>
Returns a list consisting of the names of all columns.

<DT><STRONG><A NAME="item_column">column &quot;column&quot;</A></STRONG><DD>
<P>
Returns the column object (see <A HREF="../FS/dbdef_column.html">FS::dbdef_column</A>) for ``column''.

<DT><STRONG><A NAME="item_sql_create_table">sql_create_table [ $datasrc ]</A></STRONG><DD>
<P>
Returns an array of SQL statments to create this table.

<P>
If passed a DBI <CODE>$datasrc</CODE> specifying <A HREF="../DBD/mysql.html">DBD::mysql</A>, will use MySQL-specific syntax. Non-standard syntax for other engines (if
applicable) may also be supported in the future.

</DL>
<P>
<HR>
<H1><A NAME="BUGS">BUGS</A></H1>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../FS/dbdef.html">FS::dbdef</A>, <A HREF="../FS/dbdef_unique.html">FS::dbdef_unique</A>, <A HREF="../FS/dbdef_index.html">FS::dbdef_index</A>, <A HREF="../FS/dbdef_unique.html">FS::dbdef_unique</A>,
<EM>DBI</EM>



<P>
<HR>
<H1><A NAME="VERSION">VERSION</A></H1>
<P>
$Id: dbdef_table.html,v 1.2 2000-03-03 18:22:43 ivan Exp $

</BODY>

</HTML>