shsql: transaction logs and error logs

SQL database system
| Manual page for transaction(logs)

## Transaction logs

A log containing entries for each database transaction is maintained.`` The name of this file is `logs/dbtranslog`.`` The format of the transaction log is:

`filename op user yy/mm/dd hh:mm:ss field1 .. fieldn`

  filename is the data file that was updated.``

  op describes what was done and may be one of:

    add = new record appended to file
    update_old = single record update.. previous contents
    update_new = single record update.. new contents
    delete = single record deletion.. tracked in subsequent pair of replace records

  user is the identity of the user, which can be set using IDENTITY.`` If no identity has been set, this field will be an equals-sign.``

  date and time indicate when the transaction occurred

  Finally, all data fields on the affected record are present.``

No concurrency control is maintained on the transaction log file; simultaneous updates may result in scrambled or interleaved transaction log entries.`` If this is a concern, transaction logs can be maintained one per user by setting `dbtranslog_byuser` in the project config file The `dbtranslog` name will be used, with the user identity appended, separated by a dot (.).``

## Error logs

When an error occurs it is captured and written to an error log.`` The name of this file is `logs/dberrorlog`.`` The format of the error log is:

`date time errornum user message`

  date and time indicate when the error occurred;

  errornum is the error code;

  user is the identity of the user, which can be set using IDENTITY.`` If no identity has been set, this field will be an equals-sign.``

  message describes the error.``

## Notes

There is no concurrency control on the transaction log or error log, however as noted above the transaction log can be split up by user.``

Since there is no server, there's no process that persistently has an open file descriptor on the log files.
Copyright Steve Grubb

Markup created by unroff 1.0, `` `` March 18, 2004.