dbix_even_simpler_than_dbi_huh

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: ANNOUNCE: DBIx::Recordset 0.23
From: "Gerald Richter" <richter@ecos.de>
Date: Fri, 22 Sep 2000 08:08:59 +0200

The URL

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

has entered CPAN as

  file: $CPAN/authors/id/G/GR/GRICHTER/DBIx-Recordset-0.23.tar.gz
  size: 82858 bytes
   md5: 64cafcc42278264592322d958a5d4600

* UPGRADE NOTE: Please see for the changed nameing scheme for
* automatic created links (see Changes below)


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.21:

0.23  22. Sept 2000

  - separated DBIx base classes in different files, so they are visible and
    searchable by CPAN

0.22  22. Sept 2000

  - Fixed a problem that !PrimKey was not correctly set when
    TableAttr('!Serial') was set.
  - call $sth -> finish when attempt to read after the end of
    a fetched set of records to avoid problems with to many
    open cursors.
  - backlinks of automaticly deteced links are now prefixed
    with a star ('*') instead of one dash ('-') to avoid conflicts.
    Also the prefix__ is used in backlinks now. Also if there is a
    prefix like foo__ it is included in the backlink.
    NOTE: This may break some software, but this step
    is neccessary for uniqueness. Otherwise there are situations
    where it can't be predict, which is the destination of
    a given link.
  - Fix incorrect SQL expression when an empty array is given as
    parameter to an WHERE expression.
  - Added method Reset to set the current record to the initial
    state, so a call to Next returns the first record.
  - If DBIx::Database -> new cannot handle a table it will only log
    a warning, but won't die anymore.
  - Added new Parameter !PreFetch and !Expires which can be used
    when tieing a hash, which will prefetch the data from the
    database and storing it in memory, so many accesses to these
    keys will be much faster. It is also possible to give an
    expiration time (or function) after which the data is
    refetched.

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu