sqlconstructor 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE.md +16 -0
- data/README.md +161 -0
- data/Rakefile +11 -0
- data/doc/Object.html +267 -0
- data/doc/Rakefile.html +150 -0
- data/doc/SQLAliasedList.html +717 -0
- data/doc/SQLColumn.html +326 -0
- data/doc/SQLCondList.html +318 -0
- data/doc/SQLConditional.html +1082 -0
- data/doc/SQLConditional/BasicCond.html +325 -0
- data/doc/SQLConstructor.html +763 -0
- data/doc/SQLConstructor/BasicDelete.html +383 -0
- data/doc/SQLConstructor/BasicDelete_mysql.html +368 -0
- data/doc/SQLConstructor/BasicInsert.html +339 -0
- data/doc/SQLConstructor/BasicInsert_mysql.html +325 -0
- data/doc/SQLConstructor/BasicJoin.html +408 -0
- data/doc/SQLConstructor/BasicJoin_mysql.html +439 -0
- data/doc/SQLConstructor/BasicSelect.html +554 -0
- data/doc/SQLConstructor/BasicSelect_example.html +288 -0
- data/doc/SQLConstructor/BasicSelect_mysql.html +466 -0
- data/doc/SQLConstructor/BasicUnion.html +396 -0
- data/doc/SQLConstructor/BasicUpdate.html +409 -0
- data/doc/SQLConstructor/BasicUpdate_mysql.html +310 -0
- data/doc/SQLConstructor/GenericQuery.html +797 -0
- data/doc/SQLConstructor/QAttr.html +398 -0
- data/doc/SQLConstructorTest.html +603 -0
- data/doc/SQLExporter.html +382 -0
- data/doc/SQLExporter/Exporter_generic.html +413 -0
- data/doc/SQLExporter/Exporter_mysql.html +395 -0
- data/doc/SQLObject.html +525 -0
- data/doc/SQLValList.html +322 -0
- data/doc/SQLValue.html +375 -0
- data/doc/created.rid +12 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +356 -0
- data/doc/js/darkfish.js +118 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/dialects/example-constructor_rb.html +52 -0
- data/doc/lib/dialects/mysql-constructor_rb.html +52 -0
- data/doc/lib/dialects/mysql-exporter_rb.html +54 -0
- data/doc/lib/sqlconditional_rb.html +64 -0
- data/doc/lib/sqlconstructor_rb.html +52 -0
- data/doc/lib/sqlerrors_rb.html +54 -0
- data/doc/lib/sqlexporter_rb.html +55 -0
- data/doc/lib/sqlobject_rb.html +54 -0
- data/doc/rdoc.css +763 -0
- data/doc/test/queries_rb.html +56 -0
- data/doc/test_rb.html +52 -0
- data/lib/dialects/example-constructor.rb +45 -0
- data/lib/dialects/mysql-constructor.rb +247 -0
- data/lib/dialects/mysql-exporter.rb +108 -0
- data/lib/sqlconditional.rb +196 -0
- data/lib/sqlconstructor.rb +708 -0
- data/lib/sqlerrors.rb +15 -0
- data/lib/sqlexporter.rb +125 -0
- data/lib/sqlobject.rb +284 -0
- data/test/queries.rb +92 -0
- metadata +121 -0
@@ -0,0 +1,310 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: SQLConstructor::BasicUpdate_mysql</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="../index.html">Home</a>
|
25
|
+
<a href="../index.html#classes">Classes</a>
|
26
|
+
<a href="../index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="../lib/dialects/mysql-constructor_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/dialects/mysql-constructor.rb">lib/dialects/mysql-constructor.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link"><a href="BasicUpdate.html">SQLConstructor::BasicUpdate</a></p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-c-new">::new</a></li>
|
69
|
+
|
70
|
+
</ul>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<div id="project-metadata">
|
78
|
+
|
79
|
+
|
80
|
+
<div id="fileindex-section" class="section project-section">
|
81
|
+
<h3 class="section-header">Files</h3>
|
82
|
+
<ul>
|
83
|
+
|
84
|
+
<li class="file"><a href="../Rakefile.html">Rakefile</a></li>
|
85
|
+
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
<div id="classindex-section" class="section project-section">
|
91
|
+
<h3 class="section-header">Class/Module Index
|
92
|
+
<span class="search-toggle"><img src="../images/find.png"
|
93
|
+
height="16" width="16" alt="[+]"
|
94
|
+
title="show/hide quicksearch" /></span></h3>
|
95
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
96
|
+
<fieldset>
|
97
|
+
<legend>Quicksearch</legend>
|
98
|
+
<input type="text" name="quicksearch" value=""
|
99
|
+
class="quicksearch-field" />
|
100
|
+
</fieldset>
|
101
|
+
</form>
|
102
|
+
|
103
|
+
<ul class="link-list">
|
104
|
+
|
105
|
+
<li><a href="../SQLConstructor.html">SQLConstructor</a></li>
|
106
|
+
|
107
|
+
<li><a href="../SQLConstructor/BasicDelete.html">SQLConstructor::BasicDelete</a></li>
|
108
|
+
|
109
|
+
<li><a href="../SQLConstructor/BasicDelete_mysql.html">SQLConstructor::BasicDelete_mysql</a></li>
|
110
|
+
|
111
|
+
<li><a href="../SQLConstructor/BasicInsert.html">SQLConstructor::BasicInsert</a></li>
|
112
|
+
|
113
|
+
<li><a href="../SQLConstructor/BasicInsert_mysql.html">SQLConstructor::BasicInsert_mysql</a></li>
|
114
|
+
|
115
|
+
<li><a href="../SQLConstructor/BasicJoin.html">SQLConstructor::BasicJoin</a></li>
|
116
|
+
|
117
|
+
<li><a href="../SQLConstructor/BasicJoin_mysql.html">SQLConstructor::BasicJoin_mysql</a></li>
|
118
|
+
|
119
|
+
<li><a href="../SQLConstructor/BasicSelect.html">SQLConstructor::BasicSelect</a></li>
|
120
|
+
|
121
|
+
<li><a href="../SQLConstructor/BasicSelect_example.html">SQLConstructor::BasicSelect_example</a></li>
|
122
|
+
|
123
|
+
<li><a href="../SQLConstructor/BasicSelect_mysql.html">SQLConstructor::BasicSelect_mysql</a></li>
|
124
|
+
|
125
|
+
<li><a href="../SQLConstructor/BasicUnion.html">SQLConstructor::BasicUnion</a></li>
|
126
|
+
|
127
|
+
<li><a href="../SQLConstructor/BasicUpdate.html">SQLConstructor::BasicUpdate</a></li>
|
128
|
+
|
129
|
+
<li><a href="../SQLConstructor/BasicUpdate_mysql.html">SQLConstructor::BasicUpdate_mysql</a></li>
|
130
|
+
|
131
|
+
<li><a href="../SQLConstructor/GenericQuery.html">SQLConstructor::GenericQuery</a></li>
|
132
|
+
|
133
|
+
<li><a href="../SQLConstructor/QAttr.html">SQLConstructor::QAttr</a></li>
|
134
|
+
|
135
|
+
<li><a href="../SQLExporter.html">SQLExporter</a></li>
|
136
|
+
|
137
|
+
<li><a href="../SQLExporter/Exporter_generic.html">SQLExporter::Exporter_generic</a></li>
|
138
|
+
|
139
|
+
<li><a href="../SQLExporter/Exporter_mysql.html">SQLExporter::Exporter_mysql</a></li>
|
140
|
+
|
141
|
+
<li><a href="../SQLConditional.html">SQLConditional</a></li>
|
142
|
+
|
143
|
+
<li><a href="../SQLConditional/BasicCond.html">SQLConditional::BasicCond</a></li>
|
144
|
+
|
145
|
+
<li><a href="../Object.html">Object</a></li>
|
146
|
+
|
147
|
+
<li><a href="../SQLAliasedList.html">SQLAliasedList</a></li>
|
148
|
+
|
149
|
+
<li><a href="../SQLColumn.html">SQLColumn</a></li>
|
150
|
+
|
151
|
+
<li><a href="../SQLCondList.html">SQLCondList</a></li>
|
152
|
+
|
153
|
+
<li><a href="../SQLConstructorTest.html">SQLConstructorTest</a></li>
|
154
|
+
|
155
|
+
<li><a href="../SQLObject.html">SQLObject</a></li>
|
156
|
+
|
157
|
+
<li><a href="../SQLValList.html">SQLValList</a></li>
|
158
|
+
|
159
|
+
<li><a href="../SQLValue.html">SQLValue</a></li>
|
160
|
+
|
161
|
+
</ul>
|
162
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div id="documentation">
|
170
|
+
<h1 class="class">SQLConstructor::BasicUpdate_mysql</h1>
|
171
|
+
|
172
|
+
<div id="description" class="description">
|
173
|
+
|
174
|
+
<p>MySQL dialect descendant of <a href="BasicUpdate.html">BasicUpdate</a>
|
175
|
+
class</p>
|
176
|
+
|
177
|
+
</div><!-- description -->
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<!-- Constants -->
|
189
|
+
<div id="constants-list" class="section">
|
190
|
+
<h3 class="section-header">Constants</h3>
|
191
|
+
<dl>
|
192
|
+
|
193
|
+
<dt><a name="METHODS">METHODS</a></dt>
|
194
|
+
|
195
|
+
<dd class="description"></dd>
|
196
|
+
|
197
|
+
|
198
|
+
</dl>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<!-- Attributes -->
|
204
|
+
<div id="attribute-method-details" class="method-section section">
|
205
|
+
<h3 class="section-header">Attributes</h3>
|
206
|
+
|
207
|
+
|
208
|
+
<div id="attr_limit-attribute-method" class="method-detail">
|
209
|
+
<a name="attr_limit"></a>
|
210
|
+
|
211
|
+
<div class="method-heading attribute-method-heading">
|
212
|
+
<span class="method-name">attr_limit</span><span
|
213
|
+
class="attribute-access-type">[R]</span>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div class="method-description">
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
|
223
|
+
<div id="upd_ignore-attribute-method" class="method-detail">
|
224
|
+
<a name="upd_ignore"></a>
|
225
|
+
|
226
|
+
<div class="method-heading attribute-method-heading">
|
227
|
+
<span class="method-name">upd_ignore</span><span
|
228
|
+
class="attribute-access-type">[R]</span>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div class="method-description">
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div id="upd_low_priority-attribute-method" class="method-detail">
|
239
|
+
<a name="upd_low_priority"></a>
|
240
|
+
|
241
|
+
<div class="method-heading attribute-method-heading">
|
242
|
+
<span class="method-name">upd_low_priority</span><span
|
243
|
+
class="attribute-access-type">[R]</span>
|
244
|
+
</div>
|
245
|
+
|
246
|
+
<div class="method-description">
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
</div><!-- attribute-method-details -->
|
254
|
+
|
255
|
+
|
256
|
+
<!-- Methods -->
|
257
|
+
|
258
|
+
<div id="public-class-method-details" class="method-section section">
|
259
|
+
<h3 class="section-header">Public Class Methods</h3>
|
260
|
+
|
261
|
+
|
262
|
+
<div id="new-method" class="method-detail ">
|
263
|
+
<a name="method-c-new"></a>
|
264
|
+
|
265
|
+
|
266
|
+
<div class="method-heading">
|
267
|
+
<span class="method-name">new</span><span
|
268
|
+
class="method-args">( _caller, *list )</span>
|
269
|
+
<span class="method-click-advice">click to toggle source</span>
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
<div class="method-description">
|
274
|
+
|
275
|
+
<p>Class constructor. _caller - the caller object</p>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
<div class="method-source-code" id="new-source">
|
280
|
+
<pre>
|
281
|
+
<span class="ruby-comment"># File lib/dialects/mysql-constructor.rb, line 171</span>
|
282
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> ( <span class="ruby-identifier">_caller</span>, *<span class="ruby-identifier">list</span> )
|
283
|
+
<span class="ruby-keyword">super</span>
|
284
|
+
<span class="ruby-keyword">end</span></pre>
|
285
|
+
</div><!-- new-source -->
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</div><!-- new-method -->
|
293
|
+
|
294
|
+
|
295
|
+
</div><!-- public-class-method-details -->
|
296
|
+
|
297
|
+
</div><!-- 5Buntitled-5D -->
|
298
|
+
|
299
|
+
|
300
|
+
</div><!-- documentation -->
|
301
|
+
|
302
|
+
<div id="validator-badges">
|
303
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
304
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
305
|
+
Rdoc Generator</a> 2</small>.</p>
|
306
|
+
</div>
|
307
|
+
|
308
|
+
</body>
|
309
|
+
</html>
|
310
|
+
|
@@ -0,0 +1,797 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: SQLConstructor::GenericQuery</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
16
|
+
|
17
|
+
</head>
|
18
|
+
<body id="top" class="class">
|
19
|
+
|
20
|
+
<div id="metadata">
|
21
|
+
<div id="home-metadata">
|
22
|
+
<div id="home-section" class="section">
|
23
|
+
<h3 class="section-header">
|
24
|
+
<a href="../index.html">Home</a>
|
25
|
+
<a href="../index.html#classes">Classes</a>
|
26
|
+
<a href="../index.html#methods">Methods</a>
|
27
|
+
</h3>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div id="file-metadata">
|
32
|
+
<div id="file-list-section" class="section">
|
33
|
+
<h3 class="section-header">In Files</h3>
|
34
|
+
<div class="section-body">
|
35
|
+
<ul>
|
36
|
+
|
37
|
+
<li><a href="../lib/sqlconstructor_rb.html?TB_iframe=true&height=550&width=785"
|
38
|
+
class="thickbox" title="lib/sqlconstructor.rb">lib/sqlconstructor.rb</a></li>
|
39
|
+
|
40
|
+
</ul>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div id="class-metadata">
|
48
|
+
|
49
|
+
<!-- Parent Class -->
|
50
|
+
<div id="parent-class-section" class="section">
|
51
|
+
<h3 class="section-header">Parent</h3>
|
52
|
+
|
53
|
+
<p class="link"><a href="../SQLObject.html">SQLObject</a></p>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Method Quickref -->
|
64
|
+
<div id="method-list-section" class="section">
|
65
|
+
<h3 class="section-header">Methods</h3>
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="#method-c-new">::new</a></li>
|
69
|
+
|
70
|
+
<li><a href="#method-i-_addJoin">#_addJoin</a></li>
|
71
|
+
|
72
|
+
<li><a href="#method-i-_get">#_get</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-_getBasicClass">#_getBasicClass</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-_remove">#_remove</a></li>
|
77
|
+
|
78
|
+
<li><a href="#method-i-_setMethods">#_setMethods</a></li>
|
79
|
+
|
80
|
+
<li><a href="#method-i-method_missing">#method_missing</a></li>
|
81
|
+
|
82
|
+
<li><a href="#method-i-to_s">#to_s</a></li>
|
83
|
+
|
84
|
+
<li><a href="#method-i-to_str">#to_str</a></li>
|
85
|
+
|
86
|
+
</ul>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="project-metadata">
|
94
|
+
|
95
|
+
|
96
|
+
<div id="fileindex-section" class="section project-section">
|
97
|
+
<h3 class="section-header">Files</h3>
|
98
|
+
<ul>
|
99
|
+
|
100
|
+
<li class="file"><a href="../Rakefile.html">Rakefile</a></li>
|
101
|
+
|
102
|
+
</ul>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
<div id="classindex-section" class="section project-section">
|
107
|
+
<h3 class="section-header">Class/Module Index
|
108
|
+
<span class="search-toggle"><img src="../images/find.png"
|
109
|
+
height="16" width="16" alt="[+]"
|
110
|
+
title="show/hide quicksearch" /></span></h3>
|
111
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
112
|
+
<fieldset>
|
113
|
+
<legend>Quicksearch</legend>
|
114
|
+
<input type="text" name="quicksearch" value=""
|
115
|
+
class="quicksearch-field" />
|
116
|
+
</fieldset>
|
117
|
+
</form>
|
118
|
+
|
119
|
+
<ul class="link-list">
|
120
|
+
|
121
|
+
<li><a href="../SQLConstructor.html">SQLConstructor</a></li>
|
122
|
+
|
123
|
+
<li><a href="../SQLConstructor/BasicDelete.html">SQLConstructor::BasicDelete</a></li>
|
124
|
+
|
125
|
+
<li><a href="../SQLConstructor/BasicDelete_mysql.html">SQLConstructor::BasicDelete_mysql</a></li>
|
126
|
+
|
127
|
+
<li><a href="../SQLConstructor/BasicInsert.html">SQLConstructor::BasicInsert</a></li>
|
128
|
+
|
129
|
+
<li><a href="../SQLConstructor/BasicInsert_mysql.html">SQLConstructor::BasicInsert_mysql</a></li>
|
130
|
+
|
131
|
+
<li><a href="../SQLConstructor/BasicJoin.html">SQLConstructor::BasicJoin</a></li>
|
132
|
+
|
133
|
+
<li><a href="../SQLConstructor/BasicJoin_mysql.html">SQLConstructor::BasicJoin_mysql</a></li>
|
134
|
+
|
135
|
+
<li><a href="../SQLConstructor/BasicSelect.html">SQLConstructor::BasicSelect</a></li>
|
136
|
+
|
137
|
+
<li><a href="../SQLConstructor/BasicSelect_example.html">SQLConstructor::BasicSelect_example</a></li>
|
138
|
+
|
139
|
+
<li><a href="../SQLConstructor/BasicSelect_mysql.html">SQLConstructor::BasicSelect_mysql</a></li>
|
140
|
+
|
141
|
+
<li><a href="../SQLConstructor/BasicUnion.html">SQLConstructor::BasicUnion</a></li>
|
142
|
+
|
143
|
+
<li><a href="../SQLConstructor/BasicUpdate.html">SQLConstructor::BasicUpdate</a></li>
|
144
|
+
|
145
|
+
<li><a href="../SQLConstructor/BasicUpdate_mysql.html">SQLConstructor::BasicUpdate_mysql</a></li>
|
146
|
+
|
147
|
+
<li><a href="../SQLConstructor/GenericQuery.html">SQLConstructor::GenericQuery</a></li>
|
148
|
+
|
149
|
+
<li><a href="../SQLConstructor/QAttr.html">SQLConstructor::QAttr</a></li>
|
150
|
+
|
151
|
+
<li><a href="../SQLExporter.html">SQLExporter</a></li>
|
152
|
+
|
153
|
+
<li><a href="../SQLExporter/Exporter_generic.html">SQLExporter::Exporter_generic</a></li>
|
154
|
+
|
155
|
+
<li><a href="../SQLExporter/Exporter_mysql.html">SQLExporter::Exporter_mysql</a></li>
|
156
|
+
|
157
|
+
<li><a href="../SQLConditional.html">SQLConditional</a></li>
|
158
|
+
|
159
|
+
<li><a href="../SQLConditional/BasicCond.html">SQLConditional::BasicCond</a></li>
|
160
|
+
|
161
|
+
<li><a href="../Object.html">Object</a></li>
|
162
|
+
|
163
|
+
<li><a href="../SQLAliasedList.html">SQLAliasedList</a></li>
|
164
|
+
|
165
|
+
<li><a href="../SQLColumn.html">SQLColumn</a></li>
|
166
|
+
|
167
|
+
<li><a href="../SQLCondList.html">SQLCondList</a></li>
|
168
|
+
|
169
|
+
<li><a href="../SQLConstructorTest.html">SQLConstructorTest</a></li>
|
170
|
+
|
171
|
+
<li><a href="../SQLObject.html">SQLObject</a></li>
|
172
|
+
|
173
|
+
<li><a href="../SQLValList.html">SQLValList</a></li>
|
174
|
+
|
175
|
+
<li><a href="../SQLValue.html">SQLValue</a></li>
|
176
|
+
|
177
|
+
</ul>
|
178
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
<div id="documentation">
|
186
|
+
<h1 class="class">SQLConstructor::GenericQuery</h1>
|
187
|
+
|
188
|
+
<div id="description" class="description">
|
189
|
+
|
190
|
+
<p>Internal class - generic query attributes and methods. Should be parent to
|
191
|
+
all Basic* classes.</p>
|
192
|
+
|
193
|
+
</div><!-- description -->
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<div id="5Buntitled-5D" class="documentation-section">
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
<!-- Attributes -->
|
207
|
+
<div id="attribute-method-details" class="method-section section">
|
208
|
+
<h3 class="section-header">Attributes</h3>
|
209
|
+
|
210
|
+
|
211
|
+
<div id="attr_index_hints-attribute-method" class="method-detail">
|
212
|
+
<a name="attr_index_hints"></a>
|
213
|
+
|
214
|
+
<div class="method-heading attribute-method-heading">
|
215
|
+
<span class="method-name">attr_index_hints</span><span
|
216
|
+
class="attribute-access-type">[R]</span>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
<div class="method-description">
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</div>
|
224
|
+
</div>
|
225
|
+
|
226
|
+
<div id="caller-attribute-method" class="method-detail">
|
227
|
+
<a name="caller"></a>
|
228
|
+
|
229
|
+
<a name="caller="></a>
|
230
|
+
|
231
|
+
<div class="method-heading attribute-method-heading">
|
232
|
+
<span class="method-name">caller</span><span
|
233
|
+
class="attribute-access-type">[RW]</span>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</div>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div id="child_caller-attribute-method" class="method-detail">
|
244
|
+
<a name="child_caller"></a>
|
245
|
+
|
246
|
+
<div class="method-heading attribute-method-heading">
|
247
|
+
<span class="method-name">child_caller</span><span
|
248
|
+
class="attribute-access-type">[R]</span>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<div class="method-description">
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
</div>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
<div id="dialect-attribute-method" class="method-detail">
|
259
|
+
<a name="dialect"></a>
|
260
|
+
|
261
|
+
<div class="method-heading attribute-method-heading">
|
262
|
+
<span class="method-name">dialect</span><span
|
263
|
+
class="attribute-access-type">[R]</span>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
<div class="method-description">
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
</div>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
<div id="exporter-attribute-method" class="method-detail">
|
274
|
+
<a name="exporter"></a>
|
275
|
+
|
276
|
+
<div class="method-heading attribute-method-heading">
|
277
|
+
<span class="method-name">exporter</span><span
|
278
|
+
class="attribute-access-type">[R]</span>
|
279
|
+
</div>
|
280
|
+
|
281
|
+
<div class="method-description">
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div id="string-attribute-method" class="method-detail">
|
289
|
+
<a name="string"></a>
|
290
|
+
|
291
|
+
<a name="string="></a>
|
292
|
+
|
293
|
+
<div class="method-heading attribute-method-heading">
|
294
|
+
<span class="method-name">string</span><span
|
295
|
+
class="attribute-access-type">[RW]</span>
|
296
|
+
</div>
|
297
|
+
|
298
|
+
<div class="method-description">
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
<div id="tidy-attribute-method" class="method-detail">
|
306
|
+
<a name="tidy"></a>
|
307
|
+
|
308
|
+
<div class="method-heading attribute-method-heading">
|
309
|
+
<span class="method-name">tidy</span><span
|
310
|
+
class="attribute-access-type">[R]</span>
|
311
|
+
</div>
|
312
|
+
|
313
|
+
<div class="method-description">
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
</div>
|
318
|
+
</div>
|
319
|
+
|
320
|
+
<div id="type-attribute-method" class="method-detail">
|
321
|
+
<a name="type"></a>
|
322
|
+
|
323
|
+
<div class="method-heading attribute-method-heading">
|
324
|
+
<span class="method-name">type</span><span
|
325
|
+
class="attribute-access-type">[R]</span>
|
326
|
+
</div>
|
327
|
+
|
328
|
+
<div class="method-description">
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
</div>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
</div><!-- attribute-method-details -->
|
336
|
+
|
337
|
+
|
338
|
+
<!-- Methods -->
|
339
|
+
|
340
|
+
<div id="public-class-method-details" class="method-section section">
|
341
|
+
<h3 class="section-header">Public Class Methods</h3>
|
342
|
+
|
343
|
+
|
344
|
+
<div id="new-method" class="method-detail ">
|
345
|
+
<a name="method-c-new"></a>
|
346
|
+
|
347
|
+
|
348
|
+
<div class="method-heading">
|
349
|
+
<span class="method-name">new</span><span
|
350
|
+
class="method-args">( _caller )</span>
|
351
|
+
<span class="method-click-advice">click to toggle source</span>
|
352
|
+
</div>
|
353
|
+
|
354
|
+
|
355
|
+
<div class="method-description">
|
356
|
+
|
357
|
+
<p>Class constructor. _caller - the caller object</p>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
<div class="method-source-code" id="new-source">
|
362
|
+
<pre>
|
363
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 242</span>
|
364
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> ( <span class="ruby-identifier">_caller</span> )
|
365
|
+
<span class="ruby-ivar">@caller</span> = <span class="ruby-identifier">_caller</span>
|
366
|
+
<span class="ruby-ivar">@dialect</span> = <span class="ruby-ivar">@caller</span>.<span class="ruby-identifier">dialect</span>
|
367
|
+
<span class="ruby-ivar">@tidy</span> = <span class="ruby-ivar">@caller</span>.<span class="ruby-identifier">tidy</span>
|
368
|
+
<span class="ruby-ivar">@exporter</span> = <span class="ruby-identifier">_caller</span>.<span class="ruby-identifier">exporter</span>
|
369
|
+
<span class="ruby-ivar">@inline</span> = <span class="ruby-ivar">@caller</span>.<span class="ruby-identifier">inline</span>
|
370
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">_setMethods</span>
|
371
|
+
<span class="ruby-keyword">end</span></pre>
|
372
|
+
</div><!-- new-source -->
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</div><!-- new-method -->
|
380
|
+
|
381
|
+
|
382
|
+
</div><!-- public-class-method-details -->
|
383
|
+
|
384
|
+
<div id="public-instance-method-details" class="method-section section">
|
385
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
386
|
+
|
387
|
+
|
388
|
+
<div id="_get-method" class="method-detail ">
|
389
|
+
<a name="method-i-_get"></a>
|
390
|
+
|
391
|
+
|
392
|
+
<div class="method-heading">
|
393
|
+
<span class="method-name">_get</span><span
|
394
|
+
class="method-args">( clause, *args )</span>
|
395
|
+
<span class="method-click-advice">click to toggle source</span>
|
396
|
+
</div>
|
397
|
+
|
398
|
+
|
399
|
+
<div class="method-description">
|
400
|
+
|
401
|
+
<p>Returns an object by clause (keys of child class’ METHODS attribute) or by
|
402
|
+
<a href="../SQLObject.html#attribute-i-name">SQLObject.name</a></p>
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
<div class="method-source-code" id="_get-source">
|
407
|
+
<pre>
|
408
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 255</span>
|
409
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_get</span> ( <span class="ruby-identifier">clause</span>, *<span class="ruby-identifier">args</span> )
|
410
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span>
|
411
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@methods</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">clause</span>
|
412
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
|
413
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-ivar">@methods</span>[<span class="ruby-identifier">clause</span>].<span class="ruby-identifier">name</span>
|
414
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">val</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">QAttr</span>
|
415
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">&&</span> [ <span class="ruby-constant">Array</span>, <span class="ruby-constant">SQLValList</span>, <span class="ruby-constant">SQLAliasedList</span>, <span class="ruby-constant">SQLCondList</span> ].<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">result</span>.<span class="ruby-identifier">class</span> )
|
416
|
+
<span class="ruby-comment"># return the first object if multiple objects have the same name</span>
|
417
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> }
|
418
|
+
<span class="ruby-keyword">end</span>
|
419
|
+
<span class="ruby-keyword">end</span>
|
420
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
|
421
|
+
<span class="ruby-keyword">end</span></pre>
|
422
|
+
</div><!-- _get-source -->
|
423
|
+
|
424
|
+
</div>
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
</div><!-- _get-method -->
|
430
|
+
|
431
|
+
|
432
|
+
<div id="_remove-method" class="method-detail ">
|
433
|
+
<a name="method-i-_remove"></a>
|
434
|
+
|
435
|
+
|
436
|
+
<div class="method-heading">
|
437
|
+
<span class="method-name">_remove</span><span
|
438
|
+
class="method-args">( clause, *args )</span>
|
439
|
+
<span class="method-click-advice">click to toggle source</span>
|
440
|
+
</div>
|
441
|
+
|
442
|
+
|
443
|
+
<div class="method-description">
|
444
|
+
|
445
|
+
<p>NILs attribute by clause name (specified in the child class’ METHODS
|
446
|
+
attribure), or removes an named item from a list attribute. This method
|
447
|
+
must be overriden in child classes if any methods were defined explicitly
|
448
|
+
(not in METHODS).</p>
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
<div class="method-source-code" id="_remove-source">
|
453
|
+
<pre>
|
454
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 275</span>
|
455
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_remove</span> ( <span class="ruby-identifier">clause</span>, *<span class="ruby-identifier">args</span> )
|
456
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@methods</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">clause</span>
|
457
|
+
<span class="ruby-identifier">_attr</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-ivar">@methods</span>[<span class="ruby-identifier">clause</span>].<span class="ruby-identifier">name</span>
|
458
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
|
459
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">&&</span> [ <span class="ruby-constant">Array</span>, <span class="ruby-constant">SQLValList</span>, <span class="ruby-constant">SQLAliasedList</span>, <span class="ruby-constant">SQLCondList</span> ].<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">class</span> )
|
460
|
+
<span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> }
|
461
|
+
<span class="ruby-keyword">else</span>
|
462
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-node">"#{@methods[clause].name}="</span>, <span class="ruby-keyword">nil</span>
|
463
|
+
<span class="ruby-keyword">end</span>
|
464
|
+
<span class="ruby-ivar">@string</span> = <span class="ruby-keyword">nil</span>
|
465
|
+
<span class="ruby-keyword">end</span>
|
466
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>
|
467
|
+
<span class="ruby-keyword">end</span></pre>
|
468
|
+
</div><!-- _remove-source -->
|
469
|
+
|
470
|
+
</div>
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
</div><!-- _remove-method -->
|
476
|
+
|
477
|
+
|
478
|
+
<div id="method_missing-method" class="method-detail ">
|
479
|
+
<a name="method-i-method_missing"></a>
|
480
|
+
|
481
|
+
|
482
|
+
<div class="method-heading">
|
483
|
+
<span class="method-name">method_missing</span><span
|
484
|
+
class="method-args">( method, *args )</span>
|
485
|
+
<span class="method-click-advice">click to toggle source</span>
|
486
|
+
</div>
|
487
|
+
|
488
|
+
|
489
|
+
<div class="method-description">
|
490
|
+
|
491
|
+
<p>Process method calls described in the child’s METHODS attribute. If no
|
492
|
+
corresponding entries are found in all object’s parent classes, then send
|
493
|
+
missing methods calls to the @caller object.</p>
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
<div class="method-source-code" id="method_missing-source">
|
498
|
+
<pre>
|
499
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 303</span>
|
500
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">method_missing</span> ( <span class="ruby-identifier">method</span>, *<span class="ruby-identifier">args</span> )
|
501
|
+
<span class="ruby-comment"># If the method is described in the class' METHODS constant, then</span>
|
502
|
+
<span class="ruby-comment"># create an attribute with the proper name, an attr_accessor</span>
|
503
|
+
<span class="ruby-comment"># for it, and set it's value to the one in METHODS.</span>
|
504
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@methods</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">method</span>
|
505
|
+
<span class="ruby-identifier">_attr</span> = <span class="ruby-ivar">@methods</span>[<span class="ruby-identifier">method</span>].<span class="ruby-identifier">dup</span>
|
506
|
+
<span class="ruby-identifier">attr_name</span> = <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">name</span>
|
507
|
+
<span class="ruby-identifier">val_obj</span> = <span class="ruby-keyword">nil</span>
|
508
|
+
|
509
|
+
<span class="ruby-comment"># get the current value of the attribute {_attr.name}</span>
|
510
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">send</span> <span class="ruby-value">:attr_accessor</span>, <span class="ruby-identifier">attr_name</span>.<span class="ruby-identifier">to_sym</span>
|
511
|
+
<span class="ruby-identifier">cur_attr</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">attr_name</span>.<span class="ruby-identifier">to_sym</span>
|
512
|
+
<span class="ruby-identifier">cur_attr_val</span> = <span class="ruby-identifier">cur_attr</span>.<span class="ruby-identifier">is_a?</span>( <span class="ruby-constant">QAttr</span> ) <span class="ruby-operator">?</span> <span class="ruby-identifier">cur_attr</span>.<span class="ruby-identifier">val</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">cur_attr</span>
|
513
|
+
|
514
|
+
<span class="ruby-comment"># Create an instance of the corresponding class if _attr.val is </span>
|
515
|
+
<span class="ruby-comment"># on of SQLObject container classes:</span>
|
516
|
+
<span class="ruby-keyword">if</span> [ <span class="ruby-constant">SQLValList</span>, <span class="ruby-constant">SQLAliasedList</span>, <span class="ruby-constant">SQLCondList</span> ].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span>
|
517
|
+
<span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> = <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span>.<span class="ruby-identifier">new</span> *<span class="ruby-identifier">args</span>
|
518
|
+
|
519
|
+
<span class="ruby-comment"># Create an array of SQLObjects if _attr.val is SQLObject class:</span>
|
520
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SQLObject</span>
|
521
|
+
<span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> = <span class="ruby-constant">SQLObject</span>.<span class="ruby-identifier">get</span> *<span class="ruby-identifier">args</span> <span class="ruby-comment">#args.map{ |arg| SQLObject.get arg }</span>
|
522
|
+
|
523
|
+
<span class="ruby-comment"># Create an instance of the corresponding class if _attr.val is </span>
|
524
|
+
<span class="ruby-comment"># SQLConstructor or SQLConditional class:</span>
|
525
|
+
<span class="ruby-keyword">elsif</span> [ <span class="ruby-constant">SQLConstructor</span>, <span class="ruby-constant">SQLConditional</span> ].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span>
|
526
|
+
<span class="ruby-identifier">val_obj</span> = <span class="ruby-identifier">cur_attr_val</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span>.<span class="ruby-identifier">new</span>(
|
527
|
+
<span class="ruby-value">:dialect</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@dialect</span>,
|
528
|
+
<span class="ruby-value">:tidy</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@tidy</span>,
|
529
|
+
<span class="ruby-value">:exporter</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@exporter</span>,
|
530
|
+
<span class="ruby-value">:caller</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>
|
531
|
+
)
|
532
|
+
<span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> = <span class="ruby-identifier">val_obj</span>
|
533
|
+
|
534
|
+
<span class="ruby-comment"># create a BasicSelect dialect-specific child class: </span>
|
535
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> <span class="ruby-operator">==</span> <span class="ruby-constant">BasicSelect</span>
|
536
|
+
<span class="ruby-identifier">val_obj</span> = <span class="ruby-constant">SQLConstructor</span>.<span class="ruby-identifier">new</span>(
|
537
|
+
<span class="ruby-value">:dialect</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@dialect</span>,
|
538
|
+
<span class="ruby-value">:tidy</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@tidy</span>,
|
539
|
+
<span class="ruby-value">:exporter</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@exporter</span>
|
540
|
+
).<span class="ruby-identifier">select</span>( *<span class="ruby-identifier">args</span> )
|
541
|
+
<span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> = <span class="ruby-identifier">val_obj</span>
|
542
|
+
|
543
|
+
<span class="ruby-comment"># If the :val parameter is some different class, then we should </span>
|
544
|
+
<span class="ruby-comment"># create an instance of it or return the existing value:</span>
|
545
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">include?</span>( <span class="ruby-constant">GenericQuery</span> )
|
546
|
+
<span class="ruby-identifier">val_obj</span> = <span class="ruby-identifier">_getBasicClass</span>( <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span>, <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">text</span> )
|
547
|
+
<span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span> = <span class="ruby-identifier">val_obj</span>
|
548
|
+
<span class="ruby-keyword">end</span>
|
549
|
+
|
550
|
+
<span class="ruby-comment"># If the object already has attribute {_attr.name} defined and it's</span>
|
551
|
+
<span class="ruby-comment"># an array or one of the SQL* class containers,then we should rather </span>
|
552
|
+
<span class="ruby-comment"># append to it than reassign the value.</span>
|
553
|
+
<span class="ruby-comment"># If :attr_val=list, then create a new SQLAliasedList container.</span>
|
554
|
+
<span class="ruby-keyword">if</span> [ <span class="ruby-constant">Array</span>, <span class="ruby-constant">SQLValList</span>, <span class="ruby-constant">SQLAliasedList</span>, <span class="ruby-constant">SQLCondList</span> ].<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">cur_attr_val</span>.<span class="ruby-identifier">class</span> ) <span class="ruby-operator">||</span>
|
555
|
+
<span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val_type</span> <span class="ruby-operator">==</span> <span class="ruby-string">'list'</span>
|
556
|
+
<span class="ruby-identifier">cur_attr_val</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">SQLAliasedList</span>.<span class="ruby-identifier">new</span>
|
557
|
+
<span class="ruby-identifier">cur_attr_val</span>.<span class="ruby-identifier">no_commas</span> = <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">no_commas</span>
|
558
|
+
<span class="ruby-identifier">cur_attr_val</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">_attr</span>.<span class="ruby-identifier">val</span>
|
559
|
+
<span class="ruby-identifier">_attr</span> = <span class="ruby-identifier">cur_attr_val</span>
|
560
|
+
<span class="ruby-keyword">end</span>
|
561
|
+
|
562
|
+
<span class="ruby-comment"># self.class.send :attr_accessor, attr_name.to_sym if ! cur_attr_val</span>
|
563
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-node">"#{attr_name}="</span>, <span class="ruby-identifier">_attr</span>
|
564
|
+
|
565
|
+
<span class="ruby-ivar">@string</span> = <span class="ruby-keyword">nil</span>
|
566
|
+
<span class="ruby-keyword">return</span> ( <span class="ruby-identifier">val_obj</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span> )
|
567
|
+
<span class="ruby-keyword">end</span>
|
568
|
+
|
569
|
+
<span class="ruby-comment"># Otherwise send the call to @caller object</span>
|
570
|
+
<span class="ruby-ivar">@child_caller</span> = <span class="ruby-keyword">self</span>
|
571
|
+
<span class="ruby-keyword">return</span> <span class="ruby-ivar">@caller</span>.<span class="ruby-identifier">send</span>( <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span>, *<span class="ruby-identifier">args</span> ) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@caller</span>
|
572
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>, <span class="ruby-constant">ERR_UNKNOWN_METHOD</span> <span class="ruby-operator">+</span> <span class="ruby-string">": "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_s</span>
|
573
|
+
<span class="ruby-keyword">end</span></pre>
|
574
|
+
</div><!-- method_missing-source -->
|
575
|
+
|
576
|
+
</div>
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
</div><!-- method_missing-method -->
|
582
|
+
|
583
|
+
|
584
|
+
<div id="to_s-method" class="method-detail ">
|
585
|
+
<a name="method-i-to_s"></a>
|
586
|
+
|
587
|
+
|
588
|
+
<div class="method-heading">
|
589
|
+
<span class="method-name">to_s</span><span
|
590
|
+
class="method-args">()</span>
|
591
|
+
<span class="method-click-advice">click to toggle source</span>
|
592
|
+
</div>
|
593
|
+
|
594
|
+
|
595
|
+
<div class="method-description">
|
596
|
+
|
597
|
+
<p>Convert object to string by calling the .export() method of the @exporter
|
598
|
+
object.</p>
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
<div class="method-source-code" id="to_s-source">
|
603
|
+
<pre>
|
604
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 293</span>
|
605
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
606
|
+
<span class="ruby-keyword">return</span> <span class="ruby-ivar">@string</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@string</span>
|
607
|
+
<span class="ruby-ivar">@string</span> = <span class="ruby-ivar">@exporter</span>.<span class="ruby-identifier">export</span> <span class="ruby-keyword">self</span>
|
608
|
+
<span class="ruby-keyword">end</span></pre>
|
609
|
+
</div><!-- to_s-source -->
|
610
|
+
|
611
|
+
</div>
|
612
|
+
|
613
|
+
|
614
|
+
<div class="aliases">
|
615
|
+
Also aliased as: <a href="GenericQuery.html#method-i-to_str">to_str</a>
|
616
|
+
</div>
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
</div><!-- to_s-method -->
|
621
|
+
|
622
|
+
|
623
|
+
<div id="to_str-method" class="method-detail method-alias">
|
624
|
+
<a name="method-i-to_str"></a>
|
625
|
+
|
626
|
+
|
627
|
+
<div class="method-heading">
|
628
|
+
<span class="method-name">to_str</span><span
|
629
|
+
class="method-args">()</span>
|
630
|
+
<span class="method-click-advice">click to toggle source</span>
|
631
|
+
</div>
|
632
|
+
|
633
|
+
|
634
|
+
<div class="method-description">
|
635
|
+
|
636
|
+
<p>Dirty hack to make .join work on an array of GenericQueries</p>
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
</div>
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
<div class="aliases">
|
646
|
+
Alias for: <a href="GenericQuery.html#method-i-to_s">to_s</a>
|
647
|
+
</div>
|
648
|
+
|
649
|
+
</div><!-- to_str-method -->
|
650
|
+
|
651
|
+
|
652
|
+
</div><!-- public-instance-method-details -->
|
653
|
+
|
654
|
+
<div id="protected-instance-method-details" class="method-section section">
|
655
|
+
<h3 class="section-header">Protected Instance Methods</h3>
|
656
|
+
|
657
|
+
|
658
|
+
<div id="_addJoin-method" class="method-detail ">
|
659
|
+
<a name="method-i-_addJoin"></a>
|
660
|
+
|
661
|
+
|
662
|
+
<div class="method-heading">
|
663
|
+
<span class="method-name">_addJoin</span><span
|
664
|
+
class="method-args">( type, *tables )</span>
|
665
|
+
<span class="method-click-advice">click to toggle source</span>
|
666
|
+
</div>
|
667
|
+
|
668
|
+
|
669
|
+
<div class="method-description">
|
670
|
+
|
671
|
+
<p>Creates a new <a href="BasicJoin.html">BasicJoin</a> object for the JOIN
|
672
|
+
statement.</p>
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
<div class="method-source-code" id="_addJoin-source">
|
677
|
+
<pre>
|
678
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 385</span>
|
679
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_addJoin</span> ( <span class="ruby-identifier">type</span>, *<span class="ruby-identifier">tables</span> )
|
680
|
+
<span class="ruby-ivar">@string</span> = <span class="ruby-keyword">nil</span>
|
681
|
+
<span class="ruby-identifier">join</span> = <span class="ruby-identifier">_getBasicClass</span> <span class="ruby-constant">BasicJoin</span>, <span class="ruby-identifier">type</span>, *<span class="ruby-identifier">tables</span>
|
682
|
+
<span class="ruby-ivar">@attr_joins</span> <span class="ruby-operator">||=</span> [ ]
|
683
|
+
<span class="ruby-ivar">@attr_joins</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">join</span>
|
684
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">join</span>
|
685
|
+
<span class="ruby-keyword">end</span></pre>
|
686
|
+
</div><!-- _addJoin-source -->
|
687
|
+
|
688
|
+
</div>
|
689
|
+
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
</div><!-- _addJoin-method -->
|
694
|
+
|
695
|
+
|
696
|
+
<div id="_getBasicClass-method" class="method-detail ">
|
697
|
+
<a name="method-i-_getBasicClass"></a>
|
698
|
+
|
699
|
+
|
700
|
+
<div class="method-heading">
|
701
|
+
<span class="method-name">_getBasicClass</span><span
|
702
|
+
class="method-args">( class_basic, *args )</span>
|
703
|
+
<span class="method-click-advice">click to toggle source</span>
|
704
|
+
</div>
|
705
|
+
|
706
|
+
|
707
|
+
<div class="method-description">
|
708
|
+
|
709
|
+
<p>Returns an instance of Basic* child dialect-specific class</p>
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
<div class="method-source-code" id="_getBasicClass-source">
|
714
|
+
<pre>
|
715
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 396</span>
|
716
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_getBasicClass</span> ( <span class="ruby-identifier">class_basic</span>, *<span class="ruby-identifier">args</span> )
|
717
|
+
<span class="ruby-identifier">class_basic_name</span> = <span class="ruby-identifier">class_basic</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">sub</span> <span class="ruby-regexp">/^(?:\w+::)*/</span>, <span class="ruby-string">''</span>
|
718
|
+
<span class="ruby-identifier">class_child</span> = <span class="ruby-identifier">class_basic_name</span> <span class="ruby-operator">+</span> <span class="ruby-string">'_'</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@dialect</span>
|
719
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">SQLConstructor</span>.<span class="ruby-identifier">const_defined?</span> <span class="ruby-identifier">class_child</span>.<span class="ruby-identifier">to_sym</span>
|
720
|
+
<span class="ruby-constant">SQLConstructor</span>.<span class="ruby-identifier">const_get</span>( <span class="ruby-identifier">class_child</span>.<span class="ruby-identifier">to_sym</span> ).<span class="ruby-identifier">new</span> <span class="ruby-keyword">self</span>, *<span class="ruby-identifier">args</span>
|
721
|
+
<span class="ruby-keyword">else</span>
|
722
|
+
<span class="ruby-constant">SQLConstructor</span>.<span class="ruby-identifier">const_get</span>( <span class="ruby-identifier">class_basic_name</span>.<span class="ruby-identifier">to_sym</span> ).<span class="ruby-identifier">new</span> <span class="ruby-keyword">self</span>, *<span class="ruby-identifier">args</span>
|
723
|
+
<span class="ruby-keyword">end</span>
|
724
|
+
<span class="ruby-keyword">end</span></pre>
|
725
|
+
</div><!-- _getBasicClass-source -->
|
726
|
+
|
727
|
+
</div>
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
|
732
|
+
</div><!-- _getBasicClass-method -->
|
733
|
+
|
734
|
+
|
735
|
+
<div id="_setMethods-method" class="method-detail ">
|
736
|
+
<a name="method-i-_setMethods"></a>
|
737
|
+
|
738
|
+
|
739
|
+
<div class="method-heading">
|
740
|
+
<span class="method-name">_setMethods</span><span
|
741
|
+
class="method-args">()</span>
|
742
|
+
<span class="method-click-advice">click to toggle source</span>
|
743
|
+
</div>
|
744
|
+
|
745
|
+
|
746
|
+
<div class="method-description">
|
747
|
+
|
748
|
+
<p>Returns the METHODS hash of child dialect-specific class merged with
|
749
|
+
parent’s METHODS hash.</p>
|
750
|
+
|
751
|
+
|
752
|
+
|
753
|
+
<div class="method-source-code" id="_setMethods-source">
|
754
|
+
<pre>
|
755
|
+
<span class="ruby-comment"># File lib/sqlconstructor.rb, line 410</span>
|
756
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">_setMethods</span>
|
757
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span> <span class="ruby-ivar">@methods</span>
|
758
|
+
<span class="ruby-identifier">methods_self</span> = { }
|
759
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_class</span><span class="ruby-operator">|</span>
|
760
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">_class</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">include?</span> <span class="ruby-constant">SQLConstructor</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericQuery</span>
|
761
|
+
<span class="ruby-keyword">begin</span>
|
762
|
+
<span class="ruby-identifier">class_methods</span> = <span class="ruby-identifier">_class</span>.<span class="ruby-identifier">const_get</span> <span class="ruby-value">:METHODS</span> <span class="ruby-operator">||</span> { }
|
763
|
+
<span class="ruby-keyword">rescue</span>
|
764
|
+
<span class="ruby-identifier">class_methods</span> = { }
|
765
|
+
<span class="ruby-keyword">end</span>
|
766
|
+
<span class="ruby-identifier">methods_self</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">class_methods</span>
|
767
|
+
<span class="ruby-keyword">end</span>
|
768
|
+
<span class="ruby-ivar">@methods</span> = <span class="ruby-identifier">methods_self</span>
|
769
|
+
<span class="ruby-keyword">end</span>
|
770
|
+
<span class="ruby-keyword">return</span> <span class="ruby-ivar">@methods</span>
|
771
|
+
<span class="ruby-keyword">end</span></pre>
|
772
|
+
</div><!-- _setMethods-source -->
|
773
|
+
|
774
|
+
</div>
|
775
|
+
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
</div><!-- _setMethods-method -->
|
780
|
+
|
781
|
+
|
782
|
+
</div><!-- protected-instance-method-details -->
|
783
|
+
|
784
|
+
</div><!-- 5Buntitled-5D -->
|
785
|
+
|
786
|
+
|
787
|
+
</div><!-- documentation -->
|
788
|
+
|
789
|
+
<div id="validator-badges">
|
790
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
791
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
792
|
+
Rdoc Generator</a> 2</small>.</p>
|
793
|
+
</div>
|
794
|
+
|
795
|
+
</body>
|
796
|
+
</html>
|
797
|
+
|