Mailing List Archive

ANNOUNCE: DBIx::Recordset 0.24
The URL

ftp://ftp.dev.ecos.de/pub/perl/dbi/DBIx-Recordset-0.24.tar.gz

has entered CPAN as

file: $CPAN/authors/id/G/GR/GRICHTER/DBIx-Recordset-0.24.tar.gz
size: 92611 bytes
md5: 76835b342ac63d731a4eb9529613ee99

DBIx::Recordset is a perl module for abstraction and simplification of
database access.

The goal is to make standard database access (select/insert/update/delete)
easier to handle and independend of the underlying DBMS. Special attention
is
made on web applications to make it possible to handle the state-less access
and to process the posted data of formfields, but DBIx::Recordset is not
limited to web applications.


The main features of DBIx::Recordset are:

- it has a compact interface, normaly only one function call is necessary
for setup and data retrival/inseration/deletion

- it takes care about type conversion and quoting

- it is able to access/modify tables via arrays and hashs

- it can automaticly create sub-objects for tables which are logical linked
together

- it can automatily create joins based on logical links

- it has input/output filters on a per field/per type basis

- it can create WHERE expression from a hash, which is especially usefull in
a cgi environement, where you can simply pass all paramters posted to your
cgi script to DBIx::Recordset and DBIx::Recordset creates an corresponding
SELECT.

- it can create previous/next buttons for html output

- it works together with HTML::Embperl for easily genration of HTML output

- it has an own database abtraction class DBIx::Compat which gives all the
necessary information, so that DBIx::Recordset is able to work with
different database systems

- The class DBIx::Database is able to retrieve and store meta infomation
of the database in a centralised location, which can be used for later
setup. This is also usefull when running under mod_perl, because you can
do all the setup and configuration work at webserver startup time,
speeding
up your scripts when a actual request is processed.


DBIx::Recordset use the DBI API to access the database, so it should work
with every database for which a DBD driver is available (see also
DBIx::Compat)

For more information look at perldoc DBIx::Recordset.
An introduction to DBIx::Recordset can be view with perldoc Intrors.pod.
The introduction can also be viewed online at

http://perl.apache.org/embperl/Intrors.pod.cont.html

DBIx::Recordset is tested with (but should also work with other DBMS)

- DBD::mSQL
- DBD::mysql
- DBD::Pg
- DBD::Solid
- DBD::ODBC
- DBD::Oracle
- DBD::Sybase
- DBD::CSV
- DBD::Informix

SYNOPSIS

use DBIx::Recordset;

# Setup a new object and select some recods...
*set = DBIx::Recordset -> Search ({'!DataSource' => 'dbi:Oracle:....',
'!Table' => 'users',
'$where' => 'name = ? and age > ?',
'$values' => ['richter', 25] }) ;

# Get the values of field foo ...
print "First Records value of foo is $set[0]{foo}\n" ;
print "Second Records value of foo is $set[1]{foo}\n" ;
# Get the value of the field age of the current record ...
print "Age is $set{age}\n" ;

# Do another select with the already created object...
$set -> Search ({name => 'bar'}) ;

# Show the result...
print "All users with name bar:\n" ;
while ($rec = $set -> Next)
{
print $rec -> {age} ;
}

# Setup another object and insert a new record
*set2 = DBIx::Recordset -> Insert ({'!DataSource' => 'dbi:Oracle:....',
'!Table' => 'users',
'name' => 'foo',
'age' => 25 }) ;


# Update this record (change age from 25 to 99)...
$set -> Update ({age => 99}, {name => 'foo'}) ;



Changes since 0.23:

- Added Code to DBIx::Database to Create/Modify/Drop tables
See CreateTables/DropTables
- *fieldname can take an array ref, to specify different
operators for multiple values which should compared to the same
field. This is handy for selecting a range.
- Filters are correctly apply if a arrayref with multiple value
are passed to a SELECT.
- Reset error code and string in DBIx::Database -> new
- If an array of values id passed in for one field and the operator
is '=' now the IN sql operator is used, instead of a set of '='.
- Set Postgres type 1005 to not numeric. Spotted by Michael Maruka.
- Ignore errors in ListFields when retrieving metadata for a table.
- Statement handle is closed as soon as possible, to avoid out of
cursors situations.
- new parameter $expr allow to group multiple sub expressions in
a sql where, therefore allowing more complex conditions.
- Added new parameter !MergeFunc which allow to specify a function
that is called, when multiple records with the same key are found
in a DBIx::Recordset::Hash object.
- Added some code to handle table- and fieldnames which include
spaces and special charaters. This is still experimental.
- Fixed problem with !TableFilter setup
- Set correct brackets when creating an left outer join. This is necessary
for some database to join more the two tables.


Enjoy

Gerald


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: announce-unsubscribe@perl.apache.org
For additional commands, e-mail: announce-help@perl.apache.org