[DBD-SQLite] Added functionalities (hooks)

Dami Laurent (PJ) laurent.dami at justice.ge.ch
Mon Jul 20 10:22:36 GMT 2009


Hi folks,

I just committed a number of functionality improvements to DBD::Sqlite;
I hope it's OK to commit into the trunk (so far I didn't see any policy
of using branches). The changes are

    - Added support for commit/rollback/update hooks (DAMI)
    - Added support for set_authorizer (DAMI)
    - Added support for collation_needed(), and reorganised driver API
      for user-defined collations (DAMI)
    - Exported constants from sqlite3.h into DBD::SQLite namespace
(DAMI)
    - Added support in t/lib/Test.pm for checking both versions of
      driver-private methods ("func" / "sqlite_*") (DAMI)
    - Removed unused and obsolete "list_tables" from SQLite.xs (DAMI)
    - Added a default implementation for the REGEXP infix operator
(DAMI)

Most of these are just to make some sqlite hooks available to Perl
programmers.

The following design decisions are perhaps subject to discussions :

a) builtin perl collations now are coderefs in a global hash
%DBD::SQLite::COLLATION. This way, clients can add their own collations
into the hash, and these will be loaded on demand (no need to call
create_collation every time you open a $dbh).

b) the SQLite REGEXP operator is bound by default to a perl regexp
matching function.

c) I added a mechanism in t/lib/Test.pm so that test programs can test
both versions of driver-private methods, from the same source code. So
far this was only applied to 13_create_collation.t, 36_hooks.t and
37_regexp.t; but if everybody is happy with that, we could get rid of
the other  t/*_func.t tests.



Cheers, 

	Laurent Dami
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbd-sqlite/attachments/20090720/ce1ace4a/attachment.htm


More information about the DBD-SQLite mailing list