|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 2 | +<html lang='en'> |
| 3 | +<head> |
| 4 | +<title>Sequel::DatasetRun</title> |
| 5 | +<meta name='viewport' content='width=device-width, initial-scale=1'> |
| 6 | +<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'> |
| 7 | +<link href='../../css/style.css' media='screen' rel='stylesheet' type='text/css'> |
| 8 | +<script type='text/javascript'> |
| 9 | + function popupCode(url) { |
| 10 | + window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
| 11 | + } |
| 12 | + |
| 13 | + function toggleCode(id) { |
| 14 | + var code = document.getElementById(id) |
| 15 | + |
| 16 | + code.style.display = code.style.display != 'block' ? 'block' : 'none' |
| 17 | + return true |
| 18 | + } |
| 19 | + |
| 20 | + // Make codeblocks hidden by default |
| 21 | + document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>') |
| 22 | +</script> |
| 23 | +</head> |
| 24 | +<body class='page'> |
| 25 | +<div class='class' id='wrapper'> |
| 26 | +<div class='header'> |
| 27 | +<h1 class='name'><span class='type'>module</span> |
| 28 | +Sequel::DatasetRun |
| 29 | +</h1> |
| 30 | +<ol class='paths'> |
| 31 | +<li> |
| 32 | +<a href="../../files/lib/sequel/extensions/dataset_run_rb.html">lib/sequel/extensions/dataset_run.rb</a> |
| 33 | +</li> |
| 34 | +</ol> |
| 35 | +</div> |
| 36 | +<div id='content'> |
| 37 | +<div id='text'> |
| 38 | +<div id='description'></div> |
| 39 | +<div id='method-list'> |
| 40 | +<h2>Methods</h2> |
| 41 | +<h3>Public Instance</h3> |
| 42 | +<ol> |
| 43 | +<li><a href="#method-i-run">run</a></li> |
| 44 | +</ol> |
| 45 | +</div> |
| 46 | +<div id='context'> |
| 47 | +</div> |
| 48 | +<div id='section'> |
| 49 | +<div id='methods'> |
| 50 | +<h2>Public Instance methods</h2> |
| 51 | +<div class='method public-instance' id='method-method-i-run'> |
| 52 | +<a name='method-i-run'></a> |
| 53 | +<div class='synopsis'> |
| 54 | +<span class='name'>run</span><span class='arguments'>()</span> |
| 55 | + |
| 56 | +</div> |
| 57 | +<div class='description'> |
| 58 | + |
| 59 | +<p>Run the dataset’s <a href="SQL.html"><code>SQL</code></a> on the database. Returns NULL. This is useful when you want to run <a href="SQL.html"><code>SQL</code></a> without returning a result.</p> |
| 60 | + |
| 61 | +<pre class="ruby"><span class="ruby-constant">DB</span>[<span class="ruby-string">"GRANT SELECT ON ? TO ?"</span>, <span class="ruby-value">:table</span>, <span class="ruby-value">:user</span>].<span class="ruby-identifier">run</span> |
| 62 | +<span class="ruby-comment"># GRANT SELECT ON "table" TO "user"</span> |
| 63 | +</pre> |
| 64 | + |
| 65 | +</div> |
| 66 | +<div class='source'> |
| 67 | +<a class='source-toggle' href='#' onclick='toggleCode('method-i-run-source'); return false'> |
| 68 | +[show source] |
| 69 | +</a> |
| 70 | +<pre id='method-i-run-source'> <span class="ruby-comment"># File lib/sequel/extensions/dataset_run.rb</span> |
| 71 | +<span class="line-num">31</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">run</span> |
| 72 | +<span class="line-num">32</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">server</span> = <span class="ruby-ivar">@opts</span>[<span class="ruby-value">:server</span>] |
| 73 | +<span class="line-num">33</span> <span class="ruby-identifier">db</span>.<span class="ruby-identifier">run</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-value">:server</span><span class="ruby-operator">=></span><span class="ruby-identifier">server</span>) |
| 74 | +<span class="line-num">34</span> <span class="ruby-keyword">else</span> |
| 75 | +<span class="line-num">35</span> <span class="ruby-identifier">db</span>.<span class="ruby-identifier">run</span>(<span class="ruby-identifier">sql</span>) |
| 76 | +<span class="line-num">36</span> <span class="ruby-keyword">end</span> |
| 77 | +<span class="line-num">37</span> <span class="ruby-keyword">end</span></pre> |
| 78 | +</div> |
| 79 | +</div> |
| 80 | +</div> |
| 81 | +</div> |
| 82 | + |
| 83 | +</div> |
| 84 | +</div> |
| 85 | + |
| 86 | +<div id='footer-push'></div> |
| 87 | +</div> |
| 88 | +<div id='footer'> |
| 89 | +<a href="https://github.com/jeremyevans/hanna"><strong>Hanna</strong> RDoc template</a> |
| 90 | +</div> |
| 91 | +</body> |
| 92 | +</html> |
0 commit comments