DBX - Perl extension to simplify and enhance the DBI with minimal overhead
use DBX; $conn = DBX->mysql("database=test;host=localhost;", "", ""); $rs = $conn->query("SELECT * FROM test"); while($rs) { print $rs->field("client") . "\n"; $rs->field("client", "test"); $rs->move_next; }
Abstracts the DBI by providing easy-to-use wrappers.
The DBX family of modules provides a layer of abstraction over the DBI. The DBX provides a simple cursor system, and a simple field retrieval and updating system.
The DBX module exports no subroutines. To connect to a data source, use the following code:
use DBX; my $conn = DBX->mysql("database=test;host=localhost;", "", "");
Simply replace mysql with the name of the DBD driver you want to use. You should not include "dbi:mysql:" in the connection string; DBX specifies this automatically.
mysql
In the above code, $conn is a DBX::Connection object, which can be used to issue queries on the data source. DBX queries are handled by DBX::Recordset.
Requires the DBI module and appropriate DBD drivers.
delete
add
DBI, DBX::Recordset, DBX::Connection
Bill Atkins, <dbxNOSPAM@batkins.com>
Copyright 2003 by Bill Atkins
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DBX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBX
CPAN shell
perl -MCPAN -e shell install DBX
For more information on module installation, please visit the detailed CPAN module installation guide.