-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b1504d
commit 3a45d2b
Showing
24 changed files
with
1,101 additions
and
777 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
<html lang='en'> | ||
<head> | ||
<title>Sequel::Dataset::Provenance</title> | ||
<meta name='viewport' content='width=device-width, initial-scale=1'> | ||
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'> | ||
<link href='../../../css/style.css' media='screen' rel='stylesheet' type='text/css'> | ||
<script type='text/javascript'> | ||
function popupCode(url) { | ||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | ||
} | ||
|
||
function toggleCode(id) { | ||
var code = document.getElementById(id) | ||
|
||
code.style.display = code.style.display != 'block' ? 'block' : 'none' | ||
return true | ||
} | ||
|
||
// Make codeblocks hidden by default | ||
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>') | ||
</script> | ||
</head> | ||
<body class='page'> | ||
<div class='class' id='wrapper'> | ||
<div class='header'> | ||
<h1 class='name'><span class='type'>module</span> | ||
Sequel::Dataset::Provenance | ||
</h1> | ||
<ol class='paths'> | ||
<li> | ||
<a href="../../../files/lib/sequel/extensions/provenance_rb.html">lib/sequel/extensions/provenance.rb</a> | ||
</li> | ||
</ol> | ||
</div> | ||
<div id='content'> | ||
<div id='text'> | ||
<div id='description'></div> | ||
<div id='method-list'> | ||
<h2>Methods</h2> | ||
<h3>Public Instance</h3> | ||
<ol> | ||
<li><a href="#method-i-clone">clone</a></li> | ||
</ol> | ||
</div> | ||
<div id='context'> | ||
</div> | ||
<div id='section'> | ||
<div id='constants-list'> | ||
<h2>Constants</h2> | ||
<div class='name-list'> | ||
<table summary='Constants'> | ||
<tr class='top-aligned-row context-row'> | ||
<td class='context-item-name'>RUBY_STDLIB</td> | ||
<td>=</td> | ||
<td class='context-item-value'>RbConfig::CONFIG["rubylibdir"]</td> | ||
<td> </td> | ||
<td class='context-item-desc'></td> | ||
</tr> | ||
<tr class='top-aligned-row context-row'> | ||
<td class='context-item-name'>SEQUEL_LIB_PATH</td> | ||
<td>=</td> | ||
<td class='context-item-value'>(File.expand_path('../../..', __FILE__) + '/').freeze</td> | ||
<td> </td> | ||
<td class='context-item-desc'></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
<div id='methods'> | ||
<h2>Public Instance methods</h2> | ||
<div class='method public-instance' id='method-method-i-clone'> | ||
<a name='method-i-clone'></a> | ||
<div class='synopsis'> | ||
<span class='name'>clone</span><span class='arguments'>(opts = nil || (return self))</span> | ||
|
||
</div> | ||
<div class='description'> | ||
|
||
<p>Include provenance information when cloning datasets.</p> | ||
|
||
</div> | ||
<div class='source'> | ||
<a class='source-toggle' href='#' onclick='toggleCode('method-i-clone-source'); return false'> | ||
[show source] | ||
</a> | ||
<pre id='method-i-clone-source'> <span class="ruby-comment"># File lib/sequel/extensions/provenance.rb</span> | ||
<span class="line-num">44</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clone</span>(<span class="ruby-identifier">opts</span> = <span class="ruby-keyword">nil</span> <span class="ruby-operator">||</span> (<span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>)) | ||
<span class="line-num">45</span> <span class="ruby-keyword">super</span>(<span class="ruby-identifier">provenance_opts</span>(<span class="ruby-identifier">opts</span>)) | ||
<span class="line-num">46</span> <span class="ruby-keyword">end</span></pre> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div id='footer-push'></div> | ||
</div> | ||
<div id='footer'> | ||
<a href="https://github.com/jeremyevans/hanna"><strong>Hanna</strong> RDoc template</a> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
rdoc-plugins/files/lib/sequel/extensions/provenance_rb.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
<html lang='en'> | ||
<head> | ||
<title>provenance.rb</title> | ||
<meta name='viewport' content='width=device-width, initial-scale=1'> | ||
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'> | ||
<link href='../../../../css/style.css' media='screen' rel='stylesheet' type='text/css'> | ||
<script type='text/javascript'> | ||
function popupCode(url) { | ||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | ||
} | ||
|
||
function toggleCode(id) { | ||
var code = document.getElementById(id) | ||
|
||
code.style.display = code.style.display != 'block' ? 'block' : 'none' | ||
return true | ||
} | ||
|
||
// Make codeblocks hidden by default | ||
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>') | ||
</script> | ||
</head> | ||
<body class='page'> | ||
<div class='file' id='wrapper'> | ||
<div class='header'> | ||
<h1 class='name'>provenance.rb | ||
</h1> | ||
<div class='paths'> | ||
lib/sequel/extensions/provenance.rb | ||
</div> | ||
<div class='last-update'> | ||
Last Update: | ||
<span class='datetime'>2024-04-04 14:06:41 -0700</span> | ||
</div> | ||
</div> | ||
<div id='content'> | ||
<div id='text'> | ||
<div id='description'> | ||
<p>The provenance dataset extension tracks the locations of all dataset clones that resulted in the current dataset, and includes the information as a comment in the dataset’s SQL. This makes it possible to see how a query was built, which can aid debugging. Example:</p> | ||
|
||
<pre class="ruby"><span class="ruby-constant">DB</span>[<span class="ruby-value">:table</span>]. | ||
<span class="ruby-identifier">select</span>(<span class="ruby-value">:a</span>). | ||
<span class="ruby-identifier">where</span>{<span class="ruby-identifier">b</span> <span class="ruby-operator">></span> <span class="ruby-value">10</span>}. | ||
<span class="ruby-identifier">order</span>(<span class="ruby-value">:c</span>). | ||
<span class="ruby-identifier">limit</span>(<span class="ruby-value">10</span>) | ||
<span class="ruby-comment"># SQL:</span> | ||
<span class="ruby-comment"># SELECT a FROM table WHERE (b > 10) ORDER BY c LIMIT 10 --</span> | ||
<span class="ruby-comment"># -- Dataset Provenance</span> | ||
<span class="ruby-comment"># -- Keys:[:from] Source:(eval at bin/sequel:257):2:in `<main>'</span> | ||
<span class="ruby-comment"># -- Keys:[:select] Source:(eval at bin/sequel:257):3:in `<main>'</span> | ||
<span class="ruby-comment"># -- Keys:[:where] Source:(eval at bin/sequel:257):4:in `<main>'</span> | ||
<span class="ruby-comment"># -- Keys:[:order] Source:(eval at bin/sequel:257):5:in `<main>'</span> | ||
<span class="ruby-comment"># -- Keys:[:limit] Source:(eval at bin/sequel:257):6:in `<main>'</span> | ||
</pre> | ||
|
||
<p>With the above example, the source is fairly obvious and not helpful, but in real applications, where datasets can be built from multiple files, seeing where each dataset clone was made can be helpful.</p> | ||
|
||
<p>The Source listed will skip locations in the Ruby standard library as well as <a href="../../../../classes/Sequel.html"><code>Sequel</code></a> itself. Other locations can be skipped by providing a Database :provenance_caller_ignore Regexp option:</p> | ||
|
||
<pre class="ruby"><span class="ruby-constant">DB</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:provenance_caller_ignore</span>] = <span class="ruby-regexp">/\/gems\/library_name-/</span> | ||
</pre> | ||
|
||
<p>Related module: <a href="../../../../classes/Sequel/Dataset/Provenance.html"><code>Sequel::Dataset::Provenance</code></a></p> | ||
</div> | ||
<div id='context'> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div id='footer-push'></div> | ||
</div> | ||
<div id='footer'> | ||
<a href="https://github.com/jeremyevans/hanna"><strong>Hanna</strong> RDoc template</a> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.