ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/PApp-SQL/SQL.pm
(Generate patch)

Comparing PApp-SQL/SQL.pm (file contents):
Revision 1.5 by root, Sat Jan 6 03:04:03 2001 UTC vs.
Revision 1.7 by root, Mon Jan 15 00:19:55 2001 UTC

50 50
51Connect to the database given by C<($dsn,$user,$pass)>, while using the 51Connect to the database given by C<($dsn,$user,$pass)>, while using the
52flags from C<$flags>. These are just the same arguments as given to 52flags from C<$flags>. These are just the same arguments as given to
53C<DBI->connect>. 53C<DBI->connect>.
54 54
55The database handle will be cached under the unique id C<$id>. If the same 55The database handle will be cached under the unique id
56id is requested later, the cached handle will be checked (using ping), and 56C<$id|$dsn|$user|$pass>. If the same id is requested later, the
57cached handle will be checked (using ping), and the connection will
57the connection will be re-established if necessary (be sure to prefix your 58be re-established if necessary (be sure to prefix your application or
58application or module name to the id to make it "more" unique. Things like 59module name to the id to make it "more" unique. Things like __PACKAGE__ .
59__PACKAGE__ . __LINE__ work fine as well). 60__LINE__ work fine as well).
61
62The reason C<$id> is necessary is that you might specify special connect
63arguments or special flags, or you might want to configure your $DBH
64differently than maybe other applications requesting the same database
65connection. If none of this is becessary for your application you can
66leave $id empty (i.e. "").
60 67
61If specified, C<$connect> is a callback (e.g. a coderef) that will be 68If specified, C<$connect> is a callback (e.g. a coderef) that will be
62called each time a new connection is being established, with the new 69called each time a new connection is being established, with the new
63C<$dbh> as first argument. 70C<$dbh> as first argument.
64 71
241 248
242=back 249=back
243 250
244=cut 251=cut
245 252
253reinitialize;
254
246package PApp::SQL::Database; 255package PApp::SQL::Database;
247 256
248=head2 THE DATABASE CLASS 257=head2 THE DATABASE CLASS
249 258
250Again (sigh) the problem of persistency. What do you do when you have to serialize on object 259Again (sigh) the problem of persistency. What do you do when you have to serialize on object
308 317
309=back 318=back
310 319
311=cut 320=cut
312 321
313reinitialize;
314
3151; 3221;
316 323
317=head1 BUGS 324=head1 BUGS
318 325
319As of this writing, sql_fetch and sql_fetchall are not very well tested 326As of this writing, sql_fetch and sql_fetchall are not very well tested

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines