sqlconstructor 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE.md +16 -0
  3. data/README.md +161 -0
  4. data/Rakefile +11 -0
  5. data/doc/Object.html +267 -0
  6. data/doc/Rakefile.html +150 -0
  7. data/doc/SQLAliasedList.html +717 -0
  8. data/doc/SQLColumn.html +326 -0
  9. data/doc/SQLCondList.html +318 -0
  10. data/doc/SQLConditional.html +1082 -0
  11. data/doc/SQLConditional/BasicCond.html +325 -0
  12. data/doc/SQLConstructor.html +763 -0
  13. data/doc/SQLConstructor/BasicDelete.html +383 -0
  14. data/doc/SQLConstructor/BasicDelete_mysql.html +368 -0
  15. data/doc/SQLConstructor/BasicInsert.html +339 -0
  16. data/doc/SQLConstructor/BasicInsert_mysql.html +325 -0
  17. data/doc/SQLConstructor/BasicJoin.html +408 -0
  18. data/doc/SQLConstructor/BasicJoin_mysql.html +439 -0
  19. data/doc/SQLConstructor/BasicSelect.html +554 -0
  20. data/doc/SQLConstructor/BasicSelect_example.html +288 -0
  21. data/doc/SQLConstructor/BasicSelect_mysql.html +466 -0
  22. data/doc/SQLConstructor/BasicUnion.html +396 -0
  23. data/doc/SQLConstructor/BasicUpdate.html +409 -0
  24. data/doc/SQLConstructor/BasicUpdate_mysql.html +310 -0
  25. data/doc/SQLConstructor/GenericQuery.html +797 -0
  26. data/doc/SQLConstructor/QAttr.html +398 -0
  27. data/doc/SQLConstructorTest.html +603 -0
  28. data/doc/SQLExporter.html +382 -0
  29. data/doc/SQLExporter/Exporter_generic.html +413 -0
  30. data/doc/SQLExporter/Exporter_mysql.html +395 -0
  31. data/doc/SQLObject.html +525 -0
  32. data/doc/SQLValList.html +322 -0
  33. data/doc/SQLValue.html +375 -0
  34. data/doc/created.rid +12 -0
  35. data/doc/images/brick.png +0 -0
  36. data/doc/images/brick_link.png +0 -0
  37. data/doc/images/bug.png +0 -0
  38. data/doc/images/bullet_black.png +0 -0
  39. data/doc/images/bullet_toggle_minus.png +0 -0
  40. data/doc/images/bullet_toggle_plus.png +0 -0
  41. data/doc/images/date.png +0 -0
  42. data/doc/images/find.png +0 -0
  43. data/doc/images/loadingAnimation.gif +0 -0
  44. data/doc/images/macFFBgHack.png +0 -0
  45. data/doc/images/package.png +0 -0
  46. data/doc/images/page_green.png +0 -0
  47. data/doc/images/page_white_text.png +0 -0
  48. data/doc/images/page_white_width.png +0 -0
  49. data/doc/images/plugin.png +0 -0
  50. data/doc/images/ruby.png +0 -0
  51. data/doc/images/tag_green.png +0 -0
  52. data/doc/images/wrench.png +0 -0
  53. data/doc/images/wrench_orange.png +0 -0
  54. data/doc/images/zoom.png +0 -0
  55. data/doc/index.html +356 -0
  56. data/doc/js/darkfish.js +118 -0
  57. data/doc/js/jquery.js +32 -0
  58. data/doc/js/quicksearch.js +114 -0
  59. data/doc/js/thickbox-compressed.js +10 -0
  60. data/doc/lib/dialects/example-constructor_rb.html +52 -0
  61. data/doc/lib/dialects/mysql-constructor_rb.html +52 -0
  62. data/doc/lib/dialects/mysql-exporter_rb.html +54 -0
  63. data/doc/lib/sqlconditional_rb.html +64 -0
  64. data/doc/lib/sqlconstructor_rb.html +52 -0
  65. data/doc/lib/sqlerrors_rb.html +54 -0
  66. data/doc/lib/sqlexporter_rb.html +55 -0
  67. data/doc/lib/sqlobject_rb.html +54 -0
  68. data/doc/rdoc.css +763 -0
  69. data/doc/test/queries_rb.html +56 -0
  70. data/doc/test_rb.html +52 -0
  71. data/lib/dialects/example-constructor.rb +45 -0
  72. data/lib/dialects/mysql-constructor.rb +247 -0
  73. data/lib/dialects/mysql-exporter.rb +108 -0
  74. data/lib/sqlconditional.rb +196 -0
  75. data/lib/sqlconstructor.rb +708 -0
  76. data/lib/sqlerrors.rb +15 -0
  77. data/lib/sqlexporter.rb +125 -0
  78. data/lib/sqlobject.rb +284 -0
  79. data/test/queries.rb +92 -0
  80. metadata +121 -0
@@ -0,0 +1,408 @@
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::BasicJoin</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&amp;height=550&amp;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="GenericQuery.html">SQLConstructor::GenericQuery</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-join_more">#join_more</a></li>
71
+
72
+ <li><a href="#method-i-to_s">#to_s</a></li>
73
+
74
+ </ul>
75
+ </div>
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <div id="project-metadata">
82
+
83
+
84
+ <div id="fileindex-section" class="section project-section">
85
+ <h3 class="section-header">Files</h3>
86
+ <ul>
87
+
88
+ <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
89
+
90
+ </ul>
91
+ </div>
92
+
93
+
94
+ <div id="classindex-section" class="section project-section">
95
+ <h3 class="section-header">Class/Module Index
96
+ <span class="search-toggle"><img src="../images/find.png"
97
+ height="16" width="16" alt="[+]"
98
+ title="show/hide quicksearch" /></span></h3>
99
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
100
+ <fieldset>
101
+ <legend>Quicksearch</legend>
102
+ <input type="text" name="quicksearch" value=""
103
+ class="quicksearch-field" />
104
+ </fieldset>
105
+ </form>
106
+
107
+ <ul class="link-list">
108
+
109
+ <li><a href="../SQLConstructor.html">SQLConstructor</a></li>
110
+
111
+ <li><a href="../SQLConstructor/BasicDelete.html">SQLConstructor::BasicDelete</a></li>
112
+
113
+ <li><a href="../SQLConstructor/BasicDelete_mysql.html">SQLConstructor::BasicDelete_mysql</a></li>
114
+
115
+ <li><a href="../SQLConstructor/BasicInsert.html">SQLConstructor::BasicInsert</a></li>
116
+
117
+ <li><a href="../SQLConstructor/BasicInsert_mysql.html">SQLConstructor::BasicInsert_mysql</a></li>
118
+
119
+ <li><a href="../SQLConstructor/BasicJoin.html">SQLConstructor::BasicJoin</a></li>
120
+
121
+ <li><a href="../SQLConstructor/BasicJoin_mysql.html">SQLConstructor::BasicJoin_mysql</a></li>
122
+
123
+ <li><a href="../SQLConstructor/BasicSelect.html">SQLConstructor::BasicSelect</a></li>
124
+
125
+ <li><a href="../SQLConstructor/BasicSelect_example.html">SQLConstructor::BasicSelect_example</a></li>
126
+
127
+ <li><a href="../SQLConstructor/BasicSelect_mysql.html">SQLConstructor::BasicSelect_mysql</a></li>
128
+
129
+ <li><a href="../SQLConstructor/BasicUnion.html">SQLConstructor::BasicUnion</a></li>
130
+
131
+ <li><a href="../SQLConstructor/BasicUpdate.html">SQLConstructor::BasicUpdate</a></li>
132
+
133
+ <li><a href="../SQLConstructor/BasicUpdate_mysql.html">SQLConstructor::BasicUpdate_mysql</a></li>
134
+
135
+ <li><a href="../SQLConstructor/GenericQuery.html">SQLConstructor::GenericQuery</a></li>
136
+
137
+ <li><a href="../SQLConstructor/QAttr.html">SQLConstructor::QAttr</a></li>
138
+
139
+ <li><a href="../SQLExporter.html">SQLExporter</a></li>
140
+
141
+ <li><a href="../SQLExporter/Exporter_generic.html">SQLExporter::Exporter_generic</a></li>
142
+
143
+ <li><a href="../SQLExporter/Exporter_mysql.html">SQLExporter::Exporter_mysql</a></li>
144
+
145
+ <li><a href="../SQLConditional.html">SQLConditional</a></li>
146
+
147
+ <li><a href="../SQLConditional/BasicCond.html">SQLConditional::BasicCond</a></li>
148
+
149
+ <li><a href="../Object.html">Object</a></li>
150
+
151
+ <li><a href="../SQLAliasedList.html">SQLAliasedList</a></li>
152
+
153
+ <li><a href="../SQLColumn.html">SQLColumn</a></li>
154
+
155
+ <li><a href="../SQLCondList.html">SQLCondList</a></li>
156
+
157
+ <li><a href="../SQLConstructorTest.html">SQLConstructorTest</a></li>
158
+
159
+ <li><a href="../SQLObject.html">SQLObject</a></li>
160
+
161
+ <li><a href="../SQLValList.html">SQLValList</a></li>
162
+
163
+ <li><a href="../SQLValue.html">SQLValue</a></li>
164
+
165
+ </ul>
166
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
167
+ </div>
168
+
169
+
170
+ </div>
171
+ </div>
172
+
173
+ <div id="documentation">
174
+ <h1 class="class">SQLConstructor::BasicJoin</h1>
175
+
176
+ <div id="description" class="description">
177
+
178
+ <p>Internal class which represents a basic JOIN statement.</p>
179
+
180
+ </div><!-- description -->
181
+
182
+
183
+
184
+
185
+ <div id="5Buntitled-5D" class="documentation-section">
186
+
187
+
188
+
189
+
190
+
191
+ <!-- Constants -->
192
+ <div id="constants-list" class="section">
193
+ <h3 class="section-header">Constants</h3>
194
+ <dl>
195
+
196
+ <dt><a name="METHODS">METHODS</a></dt>
197
+
198
+ <dd class="description"></dd>
199
+
200
+
201
+ </dl>
202
+ </div>
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="join_on-attribute-method" class="method-detail">
212
+ <a name="join_on"></a>
213
+
214
+ <a name="join_on="></a>
215
+
216
+ <div class="method-heading attribute-method-heading">
217
+ <span class="method-name">join_on</span><span
218
+ class="attribute-access-type">[RW]</span>
219
+ </div>
220
+
221
+ <div class="method-description">
222
+
223
+
224
+
225
+ </div>
226
+ </div>
227
+
228
+ <div id="join_sources-attribute-method" class="method-detail">
229
+ <a name="join_sources"></a>
230
+
231
+ <a name="join_sources="></a>
232
+
233
+ <div class="method-heading attribute-method-heading">
234
+ <span class="method-name">join_sources</span><span
235
+ class="attribute-access-type">[RW]</span>
236
+ </div>
237
+
238
+ <div class="method-description">
239
+
240
+
241
+
242
+ </div>
243
+ </div>
244
+
245
+ <div id="join_using-attribute-method" class="method-detail">
246
+ <a name="join_using"></a>
247
+
248
+ <a name="join_using="></a>
249
+
250
+ <div class="method-heading attribute-method-heading">
251
+ <span class="method-name">join_using</span><span
252
+ class="attribute-access-type">[RW]</span>
253
+ </div>
254
+
255
+ <div class="method-description">
256
+
257
+
258
+
259
+ </div>
260
+ </div>
261
+
262
+ </div><!-- attribute-method-details -->
263
+
264
+
265
+ <!-- Methods -->
266
+
267
+ <div id="public-class-method-details" class="method-section section">
268
+ <h3 class="section-header">Public Class Methods</h3>
269
+
270
+
271
+ <div id="new-method" class="method-detail ">
272
+ <a name="method-c-new"></a>
273
+
274
+
275
+ <div class="method-heading">
276
+ <span class="method-name">new</span><span
277
+ class="method-args">( _caller, type, *sources )</span>
278
+ <span class="method-click-advice">click to toggle source</span>
279
+ </div>
280
+
281
+
282
+ <div class="method-description">
283
+
284
+ <p>Class contructor. Takes a caller object as the first argument, JOIN type
285
+ as the second argument, and a list of sources for the JOIN clause</p>
286
+
287
+
288
+
289
+ <div class="method-source-code" id="new-source">
290
+ <pre>
291
+ <span class="ruby-comment"># File lib/sqlconstructor.rb, line 446</span>
292
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> ( <span class="ruby-identifier">_caller</span>, <span class="ruby-identifier">type</span>, *<span class="ruby-identifier">sources</span> )
293
+ <span class="ruby-identifier">type</span> = <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>
294
+ <span class="ruby-identifier">type</span>.<span class="ruby-identifier">upcase!</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp">/_/</span>, <span class="ruby-string">' '</span>
295
+ <span class="ruby-keyword">super</span> <span class="ruby-identifier">_caller</span>
296
+ <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">type</span>
297
+ <span class="ruby-ivar">@join_sources</span> = <span class="ruby-constant">SQLAliasedList</span>.<span class="ruby-identifier">new</span> *<span class="ruby-identifier">sources</span>
298
+ <span class="ruby-keyword">end</span></pre>
299
+ </div><!-- new-source -->
300
+
301
+ </div>
302
+
303
+
304
+
305
+
306
+ </div><!-- new-method -->
307
+
308
+
309
+ </div><!-- public-class-method-details -->
310
+
311
+ <div id="public-instance-method-details" class="method-section section">
312
+ <h3 class="section-header">Public Instance Methods</h3>
313
+
314
+
315
+ <div id="join_more-method" class="method-detail ">
316
+ <a name="method-i-join_more"></a>
317
+
318
+
319
+ <div class="method-heading">
320
+ <span class="method-name">join_more</span><span
321
+ class="method-args">( *sources )</span>
322
+ <span class="method-click-advice">click to toggle source</span>
323
+ </div>
324
+
325
+
326
+ <div class="method-description">
327
+
328
+ <p>Adds more sources to @<a
329
+ href="BasicJoin.html#attribute-i-join_sources">join_sources</a> list</p>
330
+
331
+
332
+
333
+ <div class="method-source-code" id="join_more-source">
334
+ <pre>
335
+ <span class="ruby-comment"># File lib/sqlconstructor.rb, line 457</span>
336
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">join_more</span> ( *<span class="ruby-identifier">sources</span> )
337
+ <span class="ruby-ivar">@join_sources</span>.<span class="ruby-identifier">push</span> *<span class="ruby-identifier">sources</span>
338
+ <span class="ruby-keyword">end</span></pre>
339
+ </div><!-- join_more-source -->
340
+
341
+ </div>
342
+
343
+
344
+
345
+
346
+ </div><!-- join_more-method -->
347
+
348
+
349
+ <div id="to_s-method" class="method-detail ">
350
+ <a name="method-i-to_s"></a>
351
+
352
+
353
+ <div class="method-heading">
354
+ <span class="method-name">to_s</span><span
355
+ class="method-args">()</span>
356
+ <span class="method-click-advice">click to toggle source</span>
357
+ </div>
358
+
359
+
360
+ <div class="method-description">
361
+
362
+ <p>Export to string with sources aliases</p>
363
+
364
+
365
+
366
+ <div class="method-source-code" id="to_s-source">
367
+ <pre>
368
+ <span class="ruby-comment"># File lib/sqlconstructor.rb, line 464</span>
369
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
370
+ <span class="ruby-keyword">return</span> <span class="ruby-ivar">@string</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@string</span>
371
+ <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@type</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; &quot;</span>
372
+ <span class="ruby-identifier">arr</span> = [ ]
373
+ <span class="ruby-ivar">@join_sources</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">src</span><span class="ruby-operator">|</span>
374
+ <span class="ruby-identifier">_alias</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">alias</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">alias</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;&quot;</span>
375
+ <span class="ruby-identifier">str</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">_alias</span>
376
+ <span class="ruby-identifier">arr</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>
377
+ <span class="ruby-keyword">end</span>
378
+ <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">join</span> <span class="ruby-string">','</span>
379
+ <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@exporter</span>.<span class="ruby-identifier">separator</span>
380
+ <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;ON &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@join_on</span>.<span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@join_on</span>
381
+ <span class="ruby-ivar">@string</span> = <span class="ruby-identifier">result</span>
382
+ <span class="ruby-keyword">end</span></pre>
383
+ </div><!-- to_s-source -->
384
+
385
+ </div>
386
+
387
+
388
+
389
+
390
+ </div><!-- to_s-method -->
391
+
392
+
393
+ </div><!-- public-instance-method-details -->
394
+
395
+ </div><!-- 5Buntitled-5D -->
396
+
397
+
398
+ </div><!-- documentation -->
399
+
400
+ <div id="validator-badges">
401
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
402
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
403
+ Rdoc Generator</a> 2</small>.</p>
404
+ </div>
405
+
406
+ </body>
407
+ </html>
408
+
@@ -0,0 +1,439 @@
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::BasicJoin_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&amp;height=550&amp;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="BasicJoin.html">SQLConstructor::BasicJoin</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-_addIndexes">#_addIndexes</a></li>
71
+
72
+ <li><a href="#method-i-method_missing">#method_missing</a></li>
73
+
74
+ <li><a href="#method-i-to_s">#to_s</a></li>
75
+
76
+ <li><a href="#method-i-to_sWithAliasesIndexes">#to_sWithAliasesIndexes</a></li>
77
+
78
+ </ul>
79
+ </div>
80
+
81
+
82
+
83
+ </div>
84
+
85
+ <div id="project-metadata">
86
+
87
+
88
+ <div id="fileindex-section" class="section project-section">
89
+ <h3 class="section-header">Files</h3>
90
+ <ul>
91
+
92
+ <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
93
+
94
+ </ul>
95
+ </div>
96
+
97
+
98
+ <div id="classindex-section" class="section project-section">
99
+ <h3 class="section-header">Class/Module Index
100
+ <span class="search-toggle"><img src="../images/find.png"
101
+ height="16" width="16" alt="[+]"
102
+ title="show/hide quicksearch" /></span></h3>
103
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
104
+ <fieldset>
105
+ <legend>Quicksearch</legend>
106
+ <input type="text" name="quicksearch" value=""
107
+ class="quicksearch-field" />
108
+ </fieldset>
109
+ </form>
110
+
111
+ <ul class="link-list">
112
+
113
+ <li><a href="../SQLConstructor.html">SQLConstructor</a></li>
114
+
115
+ <li><a href="../SQLConstructor/BasicDelete.html">SQLConstructor::BasicDelete</a></li>
116
+
117
+ <li><a href="../SQLConstructor/BasicDelete_mysql.html">SQLConstructor::BasicDelete_mysql</a></li>
118
+
119
+ <li><a href="../SQLConstructor/BasicInsert.html">SQLConstructor::BasicInsert</a></li>
120
+
121
+ <li><a href="../SQLConstructor/BasicInsert_mysql.html">SQLConstructor::BasicInsert_mysql</a></li>
122
+
123
+ <li><a href="../SQLConstructor/BasicJoin.html">SQLConstructor::BasicJoin</a></li>
124
+
125
+ <li><a href="../SQLConstructor/BasicJoin_mysql.html">SQLConstructor::BasicJoin_mysql</a></li>
126
+
127
+ <li><a href="../SQLConstructor/BasicSelect.html">SQLConstructor::BasicSelect</a></li>
128
+
129
+ <li><a href="../SQLConstructor/BasicSelect_example.html">SQLConstructor::BasicSelect_example</a></li>
130
+
131
+ <li><a href="../SQLConstructor/BasicSelect_mysql.html">SQLConstructor::BasicSelect_mysql</a></li>
132
+
133
+ <li><a href="../SQLConstructor/BasicUnion.html">SQLConstructor::BasicUnion</a></li>
134
+
135
+ <li><a href="../SQLConstructor/BasicUpdate.html">SQLConstructor::BasicUpdate</a></li>
136
+
137
+ <li><a href="../SQLConstructor/BasicUpdate_mysql.html">SQLConstructor::BasicUpdate_mysql</a></li>
138
+
139
+ <li><a href="../SQLConstructor/GenericQuery.html">SQLConstructor::GenericQuery</a></li>
140
+
141
+ <li><a href="../SQLConstructor/QAttr.html">SQLConstructor::QAttr</a></li>
142
+
143
+ <li><a href="../SQLExporter.html">SQLExporter</a></li>
144
+
145
+ <li><a href="../SQLExporter/Exporter_generic.html">SQLExporter::Exporter_generic</a></li>
146
+
147
+ <li><a href="../SQLExporter/Exporter_mysql.html">SQLExporter::Exporter_mysql</a></li>
148
+
149
+ <li><a href="../SQLConditional.html">SQLConditional</a></li>
150
+
151
+ <li><a href="../SQLConditional/BasicCond.html">SQLConditional::BasicCond</a></li>
152
+
153
+ <li><a href="../Object.html">Object</a></li>
154
+
155
+ <li><a href="../SQLAliasedList.html">SQLAliasedList</a></li>
156
+
157
+ <li><a href="../SQLColumn.html">SQLColumn</a></li>
158
+
159
+ <li><a href="../SQLCondList.html">SQLCondList</a></li>
160
+
161
+ <li><a href="../SQLConstructorTest.html">SQLConstructorTest</a></li>
162
+
163
+ <li><a href="../SQLObject.html">SQLObject</a></li>
164
+
165
+ <li><a href="../SQLValList.html">SQLValList</a></li>
166
+
167
+ <li><a href="../SQLValue.html">SQLValue</a></li>
168
+
169
+ </ul>
170
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
171
+ </div>
172
+
173
+
174
+ </div>
175
+ </div>
176
+
177
+ <div id="documentation">
178
+ <h1 class="class">SQLConstructor::BasicJoin_mysql</h1>
179
+
180
+ <div id="description" class="description">
181
+
182
+ <p>MySQL dialect descendant of <a href="BasicJoin.html">BasicJoin</a> class</p>
183
+
184
+ </div><!-- description -->
185
+
186
+
187
+
188
+
189
+ <div id="5Buntitled-5D" class="documentation-section">
190
+
191
+
192
+
193
+
194
+
195
+ <!-- Constants -->
196
+ <div id="constants-list" class="section">
197
+ <h3 class="section-header">Constants</h3>
198
+ <dl>
199
+
200
+ <dt><a name="VALID_JOINS">VALID_JOINS</a></dt>
201
+
202
+ <dd class="description"></dd>
203
+
204
+
205
+ </dl>
206
+ </div>
207
+
208
+
209
+
210
+
211
+ <!-- Methods -->
212
+
213
+ <div id="public-class-method-details" class="method-section section">
214
+ <h3 class="section-header">Public Class Methods</h3>
215
+
216
+
217
+ <div id="new-method" class="method-detail ">
218
+ <a name="method-c-new"></a>
219
+
220
+
221
+ <div class="method-heading">
222
+ <span class="method-name">new</span><span
223
+ class="method-args">( _caller, type, *sources )</span>
224
+ <span class="method-click-advice">click to toggle source</span>
225
+ </div>
226
+
227
+
228
+ <div class="method-description">
229
+
230
+ <p>Class contructor. Takes a caller object as the first argument, JOIN type
231
+ as the second argument, and a list of sources for the JOIN clause</p>
232
+
233
+
234
+
235
+ <div class="method-source-code" id="new-source">
236
+ <pre>
237
+ <span class="ruby-comment"># File lib/dialects/mysql-constructor.rb, line 192</span>
238
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> ( <span class="ruby-identifier">_caller</span>, <span class="ruby-identifier">type</span>, *<span class="ruby-identifier">sources</span> )
239
+ <span class="ruby-identifier">type</span> = <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>
240
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span> <span class="ruby-constant">VALID_JOINS</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span>
241
+ <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">&quot;: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">type</span>
242
+ <span class="ruby-keyword">end</span>
243
+ <span class="ruby-keyword">super</span>
244
+ <span class="ruby-keyword">end</span></pre>
245
+ </div><!-- new-source -->
246
+
247
+ </div>
248
+
249
+
250
+
251
+
252
+ </div><!-- new-method -->
253
+
254
+
255
+ </div><!-- public-class-method-details -->
256
+
257
+ <div id="public-instance-method-details" class="method-section section">
258
+ <h3 class="section-header">Public Instance Methods</h3>
259
+
260
+
261
+ <div id="_addIndexes-method" class="method-detail ">
262
+ <a name="method-i-_addIndexes"></a>
263
+
264
+
265
+ <div class="method-heading">
266
+ <span class="method-name">_addIndexes</span><span
267
+ class="method-args">( type, *list )</span>
268
+ <span class="method-click-advice">click to toggle source</span>
269
+ </div>
270
+
271
+
272
+ <div class="method-description">
273
+
274
+ <p>Adds a USE/FORCE/IGNORE INDEX clause for the last objects in for_vals
275
+ argument.</p>
276
+
277
+
278
+
279
+ <div class="method-source-code" id="_addIndexes-source">
280
+ <pre>
281
+ <span class="ruby-comment"># File lib/dialects/mysql-constructor.rb, line 204</span>
282
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">_addIndexes</span> ( <span class="ruby-identifier">type</span>, *<span class="ruby-identifier">list</span> )
283
+ <span class="ruby-identifier">type</span> = <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>
284
+ <span class="ruby-identifier">type</span>.<span class="ruby-identifier">upcase!</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp">/_/</span>, <span class="ruby-string">' '</span>
285
+ <span class="ruby-ivar">@attr_index_hints</span> <span class="ruby-operator">||=</span> [ ]
286
+ <span class="ruby-comment"># set the attr_index_hints for the last object in for_vals</span>
287
+ <span class="ruby-identifier">last_ind</span> = <span class="ruby-ivar">@join_sources</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
288
+ <span class="ruby-ivar">@attr_index_hints</span>[<span class="ruby-identifier">last_ind</span>] = { <span class="ruby-value">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>, <span class="ruby-value">:list</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">SQLObject</span>.<span class="ruby-identifier">get</span>( <span class="ruby-identifier">list</span> ) }
289
+ <span class="ruby-ivar">@string</span> = <span class="ruby-keyword">nil</span>
290
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>
291
+ <span class="ruby-keyword">end</span></pre>
292
+ </div><!-- _addIndexes-source -->
293
+
294
+ </div>
295
+
296
+
297
+
298
+
299
+ </div><!-- _addIndexes-method -->
300
+
301
+
302
+ <div id="method_missing-method" class="method-detail ">
303
+ <a name="method-i-method_missing"></a>
304
+
305
+
306
+ <div class="method-heading">
307
+ <span class="method-name">method_missing</span><span
308
+ class="method-args">( method, *args )</span>
309
+ <span class="method-click-advice">click to toggle source</span>
310
+ </div>
311
+
312
+
313
+ <div class="method-description">
314
+
315
+ <p>Handles INDEX hints or sends the call to the parent</p>
316
+
317
+
318
+
319
+ <div class="method-source-code" id="method_missing-source">
320
+ <pre>
321
+ <span class="ruby-comment"># File lib/dialects/mysql-constructor.rb, line 229</span>
322
+ <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> )
323
+ <span class="ruby-comment"># Handle all valid *_index/*_key calls:</span>
324
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">_addIndexes</span>( <span class="ruby-identifier">method</span>, *<span class="ruby-identifier">args</span> ) <span class="ruby-keyword">if</span> <span class="ruby-constant">VALID_INDEX_HINTS</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">method</span>
325
+ <span class="ruby-keyword">super</span>
326
+ <span class="ruby-keyword">end</span></pre>
327
+ </div><!-- method_missing-source -->
328
+
329
+ </div>
330
+
331
+
332
+
333
+
334
+ </div><!-- method_missing-method -->
335
+
336
+
337
+ <div id="to_s-method" class="method-detail ">
338
+ <a name="method-i-to_s"></a>
339
+
340
+
341
+ <div class="method-heading">
342
+ <span class="method-name">to_s</span><span
343
+ class="method-args">()</span>
344
+ <span class="method-click-advice">click to toggle source</span>
345
+ </div>
346
+
347
+
348
+ <div class="method-description">
349
+
350
+ <p>Export to string with index hints included</p>
351
+
352
+
353
+
354
+ <div class="method-source-code" id="to_s-source">
355
+ <pre>
356
+ <span class="ruby-comment"># File lib/dialects/mysql-constructor.rb, line 218</span>
357
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
358
+ <span class="ruby-keyword">return</span> <span class="ruby-ivar">@string</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@string</span>
359
+ <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@type</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">to_sWithAliasesIndexes</span>( <span class="ruby-ivar">@join_sources</span> )
360
+ <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@exporter</span>.<span class="ruby-identifier">separator</span>
361
+ <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;ON &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@join_on</span>.<span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@join_on</span>
362
+ <span class="ruby-ivar">@string</span> = <span class="ruby-identifier">result</span>
363
+ <span class="ruby-keyword">end</span></pre>
364
+ </div><!-- to_s-source -->
365
+
366
+ </div>
367
+
368
+
369
+
370
+
371
+ </div><!-- to_s-method -->
372
+
373
+
374
+ </div><!-- public-instance-method-details -->
375
+
376
+ <div id="private-instance-method-details" class="method-section section">
377
+ <h3 class="section-header">Private Instance Methods</h3>
378
+
379
+
380
+ <div id="to_sWithAliasesIndexes-method" class="method-detail ">
381
+ <a name="method-i-to_sWithAliasesIndexes"></a>
382
+
383
+
384
+ <div class="method-heading">
385
+ <span class="method-name">to_sWithAliasesIndexes</span><span
386
+ class="method-args">( list )</span>
387
+ <span class="method-click-advice">click to toggle source</span>
388
+ </div>
389
+
390
+
391
+ <div class="method-description">
392
+
393
+ <p>Returns a string of objects in list merged with @attr_index_hints</p>
394
+
395
+
396
+
397
+ <div class="method-source-code" id="to_sWithAliasesIndexes-source">
398
+ <pre>
399
+ <span class="ruby-comment"># File lib/dialects/mysql-constructor.rb, line 242</span>
400
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_sWithAliasesIndexes</span> ( <span class="ruby-identifier">list</span> )
401
+ <span class="ruby-identifier">list</span> = [ <span class="ruby-identifier">list</span> ] <span class="ruby-keyword">if</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-identifier">include?</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">class</span>
402
+ <span class="ruby-identifier">arr</span> = [ ]
403
+ <span class="ruby-identifier">list</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span>,<span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
404
+ <span class="ruby-identifier">_alias</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">alias</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">alias</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;&quot;</span>
405
+ <span class="ruby-identifier">str</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">_alias</span>
406
+ <span class="ruby-keyword">if</span> <span class="ruby-ivar">@attr_index_hints</span>
407
+ <span class="ruby-identifier">index_hash</span> = <span class="ruby-ivar">@attr_index_hints</span>[<span class="ruby-identifier">i</span>]
408
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index_hash</span>[<span class="ruby-value">:type</span>] <span class="ruby-operator">+</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index_hash</span>[<span class="ruby-value">:list</span>].<span class="ruby-identifier">to_s</span>
409
+ <span class="ruby-keyword">end</span>
410
+ <span class="ruby-identifier">arr</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>
411
+ <span class="ruby-keyword">end</span>
412
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">join</span> <span class="ruby-string">','</span>
413
+ <span class="ruby-keyword">end</span></pre>
414
+ </div><!-- to_sWithAliasesIndexes-source -->
415
+
416
+ </div>
417
+
418
+
419
+
420
+
421
+ </div><!-- to_sWithAliasesIndexes-method -->
422
+
423
+
424
+ </div><!-- private-instance-method-details -->
425
+
426
+ </div><!-- 5Buntitled-5D -->
427
+
428
+
429
+ </div><!-- documentation -->
430
+
431
+ <div id="validator-badges">
432
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
433
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
434
+ Rdoc Generator</a> 2</small>.</p>
435
+ </div>
436
+
437
+ </body>
438
+ </html>
439
+