.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::DB::GFF::Adaptor::dbi::caching_handle 3pm" .TH Bio::DB::GFF::Adaptor::dbi::caching_handle 3pm "2020-01-13" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::DB::GFF::Adaptor::dbi::caching_handle \-\- Cache for database handles .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& use Bio::DB::GFF::Adaptor::dbi::caching_handle; \& $db = Bio::DB::GFF::Adaptor::dbi::caching_handle\->new(\*(Aqdbi:mysql:test\*(Aq); \& $sth = $db\->prepare(\*(Aqselect * from foo\*(Aq); \& @h = $sth\->fetch_rowarray; \& $sth\->finish .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module handles a pool of database handles. It was motivated by the \s-1MYSQL\s0 driver's {mysql_use_result} attribute, which dramatically improves query speed and memory usage, but forbids additional query statements from being evaluated while an existing one is in use. .PP This module is a plug-in replacement for vanilla \s-1DBI.\s0 It automatically activates the {mysql_use_result} attribute for the mysql driver, but avoids problems with multiple active statement handlers by creating new database handles as needed. .SH "USAGE" .IX Header "USAGE" The object constructor is Bio::DB::GFF::Adaptor::dbi::caching_handle\->\fBnew()\fR. This is called like \s-1DBI\-\s0>\fBconnect()\fR and takes the same arguments. The returned object looks and acts like a conventional database handle. .PP In addition to all the standard \s-1DBI\s0 handle methods, this package adds the following: .SS "dbi_quote" .IX Subsection "dbi_quote" .Vb 6 \& Title : dbi_quote \& Usage : $string = $db\->dbi_quote($sql,@args) \& Function: perform bind variable substitution \& Returns : query string \& Args : the query string and bind arguments \& Status : public .Ve .PP This method replaces the bind variable \*(L"?\*(R" in a \s-1SQL\s0 statement with appropriately quoted bind arguments. It is used internally to handle drivers that don't support argument binding. .SS "do_query" .IX Subsection "do_query" .Vb 6 \& Title : do_query \& Usage : $sth = $db\->do_query($query,@args) \& Function: perform a DBI query \& Returns : a statement handler \& Args : query string and list of bind arguments \& Status : Public .Ve .PP This method performs a \s-1DBI\s0 \fBprepare()\fR and \fBexecute()\fR, returning a statement handle. You will typically call \fBfetch()\fR of \fBfetchrow_array()\fR on the statement handle. The parsed statement handle is cached for later use. .SS "debug" .IX Subsection "debug" .Vb 6 \& Title : debug \& Usage : $debug = $db\->debug([$debug]) \& Function: activate debugging messages \& Returns : current state of flag \& Args : optional new setting of flag \& Status : public .Ve .SS "attribute" .IX Subsection "attribute" .Vb 6 \& Title : attribute \& Usage : $value = $db\->attribute(AttributeName , [$newvalue]) \& Function: get/set DBI::db handle attribute \& Returns : current state of the attribute \& Args : name of the attribute and optional new setting of attribute \& Status : public \& \& Under Bio::DB::GFF::Adaptor::dbi::caching_handle the DBI::db \& attributes that are usually set using hashref calls are unavailable. \& Use attribute() instead. For example, instead of: \& \& $dbh\->{AutoCommit} = 0; \& \& use \& \& $dbh\->attribute(AutoCommit=>0); .Ve .SH "BUGS" .IX Header "BUGS" Report to the author. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1DBI\s0, Bio::DB::GFF, bioperl .SH "AUTHOR" .IX Header "AUTHOR" Lincoln Stein . .PP Copyright (c) 2001 Cold Spring Harbor Laboratory. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.