Apache::WeSQL::Journalled

A library of functions to deal with an SQL database in a Journalled way.
Download

Apache::WeSQL::Journalled Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ward Vandewege
  • Publisher web site:
  • http://patch.be/htpasstool/

Apache::WeSQL::Journalled Tags


Apache::WeSQL::Journalled Description

A library of functions to deal with an SQL database in a Journalled way. Apache::WeSQL::Journalled is a Perl module of functions to deal with an SQL database in a Journalled way.SYNOPSIS use Apache::WeSQL::Journalled qw( :all );This module contains all functions necessary to deal with SQL databases in a Journalled way. You may call them directly from any WeSQL document, however, they will probably mostly be used by direct webcalls to jadd.wsql, jdelete.wsql or jmodify.wsql, with the appropriate parameters and configuration in the 'permissions.cf' file. And, of course, in the form.cf file. For more information on the format of these .cf files, see Apache::WeSQL::Display.For the journalling code to work, every table will need to have the following additional fields (MySQL definition): (for the PostgreSQL definition see the sample Addressbook application) pkey bigint(20) unsigned not null auto_increment, id bigint(20) unsigned not null, uid bigint(20) unsigned not null, suid bigint(20) unsigned not NULL default '0', epoch bigint unsigned not null, status tinyint default '1' NOT NULL,In addition to that, the 'pkey' column must be defined as the primary key: primary key (pkey)The underlying idea is that with the Journalling code, records are never (NEVER!) deleted from the database. Instead, when a record needs to be changed, its status is set to '0', and its data is copied to a new record with status '1' and changed. When a record needs to be deleted, its status is set to '0'.This allows tracing all changes to the data in your database. Of course, when the database becomes too big, you can occasionally backup and delete all records with status='0'.When the authentication has not been switched off, the userid (and possibly superuser-id) of the person doing the change is recorded in the uid and suid fields. Superusers can 'cloak' themselves to be an ordinary user. This means that when they change a record, the uid will be the id of the ordinary user, thus maintaining the ownership of the record, but the suid will be the id of the superuser. Requirements: · Perl


Apache::WeSQL::Journalled Related Software