Liz::SQL::Sanity - check databases create with Liz::SQL


 use Example;
 $example = new Example;
 $sanity = $example->Sanity;


The Liz::SQL::Sanity module is intended to be used directly by the Liz::SQL module only. It does not create its own objects.



Create a new Liz::SQL::Sanity object. Should be called with the Liz::SQL->Sanity method.

Output Parameters

 1 reference to instantiated sanity object

 use Example;
 $example = new Example;
 $sanity = $example->Sanity;

Check the variable $Liz::SQL::ERROR if there was an error when creating this object.


Check all values in the NextID table and look in the associated tables whether the ID values in there match. This method does not use the internal hashes of Liz::SQL.

Output parameters

 1 reference to list of errors that have been found
   (reference to empty list if no errors were found)
 2 reference to list of warnings
   (reference to empty list if no warnings were found)

 $sanity = $example->Sanity;
 if( @{$errors = $sanity->CheckNextID} ) {
   print "The following errors were found:\n";
   foreach( @$errors ) {
     print " $_\n";


Rebuild the NextID table in case it was crashed. If recovering of the original database files failed, you must first create a new NextID table (this can usually be done by doing a ``DELETE FROM NextID'') and then inserting a single record into the tablewhich indicates the step that was being used (``INSERT INTO NextID VALUES (NextID,1000000)'').

Then you can create your normal Liz::SQL object directly or indirectly through a client module (e.g. $hn = new HN), which in turn can be used to create a Sanity object (e.g. $sanity = $hn->Sanity), which in turn can be used to call this method (e.g. $sanity->RebuildNextID( qw(...) )).

Input Parameters

 1..N names of tables of which to repair the NextID


Elizabeth Mattijsen ( )


(C) 1998-1999 International Network Consultants


Version 0.23, 30 September 1999

Now no longer puts Exporter in ISA: it was not needed.

Version 0.22, 23 June 1999

Changed from using method ``Exists'' to ``Count'' in method CheckNextID to allow for a much quicker check whether a table exists or not.

Version 0.21, 7 October 1998

Reduced memory footprint by using fully qualified global variables only.

Version 0.2, 23 August 1998

New method RebuildNextID added: rebuilds table NextID from the ID values found the specified tables.

Version 0.1, 3 May 1998

First version of this true Perl module.