NAME

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


SYNOPSIS

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


DESCRIPTION

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


CONSTRUCTOR METHODS


new

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

Output Parameters

 1 reference to instantiated sanity object
Example

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

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


CheckNextID

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)
Example

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


RebuildNextID

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


AUTHOR

Elizabeth Mattijsen ( lizperl@INC.nl )


COPYRIGHT

(C) 1998-1999 International Network Consultants


HISTORY

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.