Bio-Chado-Schema

 view release on metacpan or  search on metacpan

doc/slides/intro/slides/start.html  view on Meta::CPAN

</div>
<!-- END slide -->


<!-- BEGIN slide -->
<div class="slide">

<h1>BCS Usage: Transactions</h1>
<pre class="formatter_pre">$chado-&gt;txn_do&#40;sub {

    $chado-&gt;resultset&#40;&#39;Cv::Cv&#39;&#41;
          -&gt;find_or_create&#40;{ name =&gt; &#39;My Fake Ontology&#39; }&#41;
          -&gt;create_related&#40; &#39;cvterm&#39;, { name =&gt; &#39;MyFakeTerm&#39; } &#41;;

    $chado-&gt;do_all_kinds_of_other_stuff;
}&#41;;
</pre>

</div>
<!-- END slide -->


<!-- BEGIN slide -->
<div class="slide">

<h1>The Real Advantages of DBIC</h1>
<ul>
<li>easier to manipulate and assemble queries</li>
<li>Don&#39;t Repeat Yourself</li>
</ul>


</div>
<!-- END slide -->


<!-- BEGIN slide -->
<div class="slide">

<h1>The Real Advantages of DBIC</h1>
<ul>
<li>it&#39;s all objects.  you can delegate to them, pass them around, etc.</li>
<li>HOWEVER:</li>
</ul>
<small>continued...</small>

</div>
<!-- END slide -->


<!-- BEGIN slide -->
<div class="slide">

<h1>The Real Advantages of DBIC</h1>
<ul>
<li>it&#39;s all objects.  you can delegate to them, pass them around, etc.</li>
<li>HOWEVER:</li>

<ul>
<li>usually you don&#39;t want to subclass them</li>
<li>but, see <tt>DBIx::Class::Manual::Cookbook</tt></li>
</ul></ul>


</div>
<!-- END slide -->


<!-- BEGIN slide -->
<div class="slide">

<h1>The Real Advantages of DBIC</h1>
<ul>
<li>complex joined queries &#40;Chado queries&#41; are very easy and compact</li>
</ul>


</div>
<!-- END slide -->


<!-- BEGIN slide -->
<div class="slide">

<h1>The Real Advantages of DBIC</h1>
<ul>
<li>SQL syntax errors are much more difficult to make</li>
</ul>


</div>
<!-- END slide -->


<!-- BEGIN slide -->
<div class="slide">

<h1>Using DBIC with your own tables</h1>
<ul>
<li>use <tt>DBIx::Class::Schema::Loader</tt> to dump a whole set</li>
<li>make your own definitions</li>
</ul>

<ul>
<li>your table: other_thing, foreign key feature_id to Chado feature table</li>
</ul>
<pre class="formatter_pre">
package My::DBIC:::Layer::OtherThing;
use base &#39;DBIx::Class::Core&#39;;

__PACKAGE__-&gt;table&#40;&#39;other_thing&#39;&#41;;
__PACKAGE__-&gt;add_columns&#40;
  &#39;other_thing_id&#39; =&gt; { ... },
  &#39;name&#39;           =&gt; { ... },
  &#39;definition&#39;     =&gt; { ... },
  &#39;feature_id&#39;     =&gt; { ... },
&#41;;
__PACKAGE__-&gt;set_primary_key&#40;&#39;other_thing_id&#39;&#41;;
__PACKAGE__-&gt;add_unique_constraint&#40;&#39;ot_c1&#39;, [&#39;name&#39;]&#41;;

__PACKAGE__-&gt;belongs_to&#40;



( run in 1.168 second using v1.01-cache-2.11-cpan-f56aa216473 )