DBI
view release on metacpan or search on metacpan
Greatly improved DBI::PurePerl in performance and accuracy.
Added more detail to DBI::PurePerl docs about what's not supported.
Fixed undef warnings from t/15array.t and DBD::Sponge.
1.22 - 2002-05-22, Tim Bunce
Added execute_array() and bind_param_array() with special thanks
to Dean Arnold. Not yet documented. See t/15array.t for examples.
All drivers now automatically support these methods.
Added DBI::PurePerl, a transparent DBI emulation for pure-perl drivers
with special thanks to Jeff Zucker. Perldoc DBI::PurePerl for details.
Added DBI::Const::GetInfo* modules thanks to Steffen Goeldner.
Added write_getinfo_pm utility to DBI::DBD thanks to Steffen Goeldner.
Added $allow_active==2 mode for prepare_cached() thanks to Stephen Clouse.
Updated DBI::Format to Revision 11.4 thanks to Tom Lowery.
Use File::Spec in Makefile.PL (helps VMS etc) thanks to Craig Berry.
Extend $h->{Warn} to commit/rollback ineffective warning thanks to Jeff Baker.
Extended t/preparse.t and removed "use Devel::Peek" thanks to Scott Hildreth.
Only copy Changes to blib/lib/Changes.pm once thanks to Jonathan Leffler.
goto post_dispatch;
}
croak("Can't locate DBI object method \"%s\" via package \"%s\"",
meth_name, HvNAME(DBIc_IMP_STASH(imp_xxh)));
}
PUSHMARK(mark); /* mark arguments again so we can pass them on */
/* Note: the handle on the stack is still an object blessed into a
* DBI::* class and not the DBD::*::* class whose method is being
* invoked. This is correct and should be largely transparent.
*/
/* SHORT-CUT ALERT! */
if (use_xsbypass && CvISXSUB(meth_cv) && CvXSUB(meth_cv)) {
/* If we are calling an XSUB we jump directly to its C code and
* bypass perl_call_sv(), pp_entersub() etc. This is fast.
* This code is based on a small section of pp_entersub().
*/
(void)(*CvXSUB(meth_cv))(aTHXo_ meth_cv); /* Call the C code directly */
ex/unicode_test.pl
lib/Bundle/DBI.pm A bundle for automatic installation via CPAN.
lib/DBD/DBM.pm A driver for DBM files (uses DBD::File)
lib/DBD/ExampleP.pm A very simple example Driver module
lib/DBD/File.pm A driver base class for simple drivers
lib/DBD/File/Developers.pod Developer documentation for DBD::File
lib/DBD/File/Roadmap.pod Roadmap for DBD::File and other Pure Perl DBD's
lib/DBD/File/HowTo.pod Guide to write a DBD::File based DBI driver
lib/DBD/Gofer.pm DBD::Gofer 'stateless proxy' driver
lib/DBD/Gofer/Policy/Base.pm
lib/DBD/Gofer/Policy/pedantic.pm Safest and most transparent, but also slowest
lib/DBD/Gofer/Policy/classic.pm Reasonable policy for typical usage
lib/DBD/Gofer/Policy/rush.pm Raw speed, fewest round trips, least transparent
lib/DBD/Gofer/Transport/Base.pm Base class for DBD::Gofer driver transport classes
lib/DBD/Gofer/Transport/corostream.pm Async Gofer transport using Coro and AnyEvent
lib/DBD/Gofer/Transport/null.pm DBD::Gofer transport that executes in same process (for testing)
lib/DBD/Gofer/Transport/pipeone.pm DBD::Gofer transport to new subprocess for each request
lib/DBD/Gofer/Transport/stream.pm DBD::Gofer transport for ssh etc
lib/DBD/Mem.pm A pure-perl in-memory driver using DBI::DBD::SqlEngine
lib/DBD/NullP.pm An empty example Driver module
lib/DBD/Proxy.pm Proxy driver
lib/DBD/Sponge.pm A driver for fake cursors (precached data)
lib/DBI/Changes.pm
lib/DBD/File/Roadmap.pod view on Meta::CPAN
=item LOCK TABLE
The newly implemented internal common table meta storage area would allow
us to implement LOCK TABLE support based on file system C<flock ()>
support.
=item Transaction support
While DBD::AnyData recommends explicitly committing by importing and
exporting tables, DBD::File might be enhanced in a future version to allow
transparent transactions using the temporary tables of SQL::Statement as
shadow (dirty) tables.
Transaction support will heavily rely on lock table support.
=item Data Dictionary Persistence
SQL::Statement provides dictionary information when a "CREATE TABLE ..."
statement is executed. This dictionary is preserved for some statement
handle attribute fetches (as C<NULLABLE> or C<PRECISION>).
lib/DBD/Gofer.pm view on Meta::CPAN
The C<...> represents attributes that influence the operation of the Gofer
driver or transport. These are described below or in the documentation of the
transport module being used.
=encoding ISO8859-1
=head1 DESCRIPTION
DBD::Gofer is a DBI database driver that forwards requests to another DBI
driver, usually in a separate process, often on a separate machine. It tries to
be as transparent as possible so it appears that you are using the remote
driver directly.
DBD::Gofer is very similar to DBD::Proxy. The major difference is that with
DBD::Gofer no state is maintained on the remote end. That means every
request contains all the information needed to create the required state. (So,
for example, every request includes the DSN to connect to.) Each request can be
sent to any available server. The server executes the request and returns a
single response that includes all the data.
This is very similar to the way http works as a stateless protocol for the web.
lib/DBD/Gofer.pm view on Meta::CPAN
=head1 CONFIGURING BEHAVIOUR POLICY
DBD::Gofer supports a 'policy' mechanism that allows you to fine-tune the number of round-trips to the Gofer server.
The policies are grouped into classes (which may be subclassed) and referenced by the name of the class.
The L<DBD::Gofer::Policy::Base> class is the base class for all the policy
packages and describes all the available policies.
Three policy packages are supplied with DBD::Gofer:
L<DBD::Gofer::Policy::pedantic> is most 'transparent' but slowest because it
makes more round-trips to the Gofer server.
L<DBD::Gofer::Policy::classic> is a reasonable compromise - it's the default policy.
L<DBD::Gofer::Policy::rush> is fastest, but may require code changes in your applications.
Generally the default C<classic> policy is fine. When first testing an existing
application with Gofer it is a good idea to start with the C<pedantic> policy
first and then switch to C<classic> or a custom policy, for final testing.
lib/DBD/Gofer/Policy/Base.pm view on Meta::CPAN
The L<DBD::Gofer::Policy::Base> class is the base class for all the policy
classes and describes all the individual policy items.
The Base policy is not used directly. You should use a policy class derived from it.
=head1 POLICY CLASSES
Three policy classes are supplied with DBD::Gofer:
L<DBD::Gofer::Policy::pedantic> is most 'transparent' but slowest because it
makes more round-trips to the Gofer server.
L<DBD::Gofer::Policy::classic> is a reasonable compromise - it's the default policy.
L<DBD::Gofer::Policy::rush> is fastest, but may require code changes in your applications.
Generally the default C<classic> policy is fine. When first testing an existing
application with Gofer it is a good idea to start with the C<pedantic> policy
first and then switch to C<classic> or a custom policy, for final testing.
lib/DBD/Gofer/Policy/pedantic.pm view on Meta::CPAN
=head1 NAME
DBD::Gofer::Policy::pedantic - The 'pedantic' policy for DBD::Gofer
=head1 SYNOPSIS
$dbh = DBI->connect("dbi:Gofer:transport=...;policy=pedantic", ...)
=head1 DESCRIPTION
The C<pedantic> policy tries to be as transparent as possible. To do this it
makes round-trips to the server for almost every DBI method call.
This is the best policy to use when first testing existing code with Gofer.
Once it's working well you should consider moving to the C<classic> policy or defining your own policy class.
Temporary docs: See the source code for list of policies and their defaults.
In a future version the policies and their defaults will be defined in the pod and parsed out at load-time.
=head1 AUTHOR
lib/DBI/Changes.pm view on Meta::CPAN
Greatly improved DBI::PurePerl in performance and accuracy.
Added more detail to DBI::PurePerl docs about what's not supported.
Fixed undef warnings from t/15array.t and DBD::Sponge.
=head2 Changes in DBI 1.22 - 22 May 2002
Added execute_array() and bind_param_array() with special thanks
to Dean Arnold. Not yet documented. See t/15array.t for examples.
All drivers now automatically support these methods.
Added DBI::PurePerl, a transparent DBI emulation for pure-perl drivers
with special thanks to Jeff Zucker. Perldoc DBI::PurePerl for details.
Added DBI::Const::GetInfo* modules thanks to Steffen Goeldner.
Added write_getinfo_pm utility to DBI::DBD thanks to Steffen Goeldner.
Added $allow_active==2 mode for prepare_cached() thanks to Stephen Clouse.
Updated DBI::Format to Revision 11.4 thanks to Tom Lowery.
Use File::Spec in Makefile.PL (helps VMS etc) thanks to Craig Berry.
Extend $h->{Warn} to commit/rollback ineffective warning thanks to Jeff Baker.
Extended t/preparse.t and removed "use Devel::Peek" thanks to Scott Hildreth.
Only copy Changes to blib/lib/Changes.pm once thanks to Jonathan Leffler.
lib/DBI/DBD/SqlEngine.pm view on Meta::CPAN
# scan tarballs instead of directories
});
When you're going to implement such a DBD::File::Archive::Tar::TableSource
class, remember to add correct attributes (including C<sql_table_source>
and C<sql_data_source>) to the returned DSN's.
=head3 DBI::DBD::SqlEngine::DataSource
Provides base functionality for dealing with tables. It is primarily
designed for allowing transparent access to files on disk or already
opened (file-)streams (e.g. for DBD::CSV).
Derived classes shall be restricted to similar functionality, too (e.g.
opening streams from an archive, transparently compress/uncompress
log files before parsing them,
package DBI::DBD::SqlEngine::DataSource;
sub complete_table_name ($$;$)
{
my ( $self, $meta, $table, $respect_case ) = @_;
...
}
lib/DBI/DBD/SqlEngine/Developers.pod view on Meta::CPAN
$dbh->func( "list_tables" );
Every time where an C<\%attr> argument can be specified, this C<\%attr>
object's C<sql_table_source> attribute is preferred over the C<$dbh>
attribute or the driver default.
=head2 DBI::DBD::SqlEngine::DataSource
Provides base functionality for dealing with tables. It is primarily
designed for allowing transparent access to files on disk or already
opened (file-)streams (e.g. for DBD::CSV).
Derived classes shall be restricted to similar functionality, too (e.g.
opening streams from an archive, transparently compress/uncompress
log files before parsing them,
package DBI::DBD::SqlEngine::DataSource;
sub complete_table_name ($$;$)
{
my ( $self, $meta, $table, $respect_case ) = @_;
...
}
t/08keeperr.t view on Meta::CPAN
$dbh->{HandleSetErr} = sub {
my ($h, $err, $errstr, $state) = @_;
return 0
unless defined $err;
++$handlewarn[ $err ? 2 : length($err) ]; # count [info, warn, err] calls
return 1
if $state && $state eq "return"; # for tests
($_[1], $_[2], $_[3]) = (99, "errstr99", "OV123")
if $state && $state eq "override"; # for tests
return 0
if $err; # be transparent for errors
local $^W;
print "HandleSetErr called: h=$h, err=$err, errstr=$errstr, state=$state\n";
return 0;
};
# start our tests
ok(!defined $DBI::err, '... $DBI::err is not defined');
# ----
t/50dbm_simple.t view on Meta::CPAN
my $dsn ="dbi:DBM(RaiseError=0,PrintError=1):dbm_type=$dtype;dbm_mldbm=$mldbm;f_lockfile=.lck";
if ($using_dbd_gofer) {
$dsn .= ";f_dir=$dir";
}
my $dbh = DBI->connect( $dsn );
my $dbm_versions;
if ($DBI::VERSION >= 1.37 # needed for install_method
&& !$ENV{DBI_AUTOPROXY} # can't transparently proxy driver-private methods
) {
$dbm_versions = $dbh->dbm_versions;
}
else {
$dbm_versions = $dbh->func('dbm_versions');
}
note $dbm_versions;
ok($dbm_versions, 'dbm_versions');
isa_ok($dbh, 'DBI::db');
t/70callbacks.t view on Meta::CPAN
$dbh->ping;
is $_, $obj, '[foreach] $_ still holds an object reference after the callback';
}
is $_, undef, '[foreach] $_ is undef at the end';
is $LeakDetect::count, 0, "[foreach] live object count is 0 after all object references are gone";
done_testing();
__END__
A generic 'transparent' callback looks like this:
(this assumes only scalar context will be used)
sub {
my $h = shift;
return if our $avoid_deep_recursion->{"$h $_"}++;
my $this = $h->$_(@_);
undef $_; # tell DBI not to call original method
return $this; # tell DBI to return this instead
};
( run in 0.721 second using v1.01-cache-2.11-cpan-0a6323c29d9 )