File/AwlDatabase.php

Description

AwlDatabase query/statement class and associated functions

This subpackage provides some functions that are useful around database activity and a AwlDBDialect, AwlDatabase and AwlStatement classes to simplify handling of database queries and provide some access for a limited ability to handle varying database dialects.

The class is intended to be a very lightweight wrapper with some features that have proved useful in developing and debugging web-based applications:

  • All queries are timed, and an expected time can be provided.
  • Parameters replaced into the SQL will be escaped correctly in order to minimise the chances of SQL injection errors.
  • Queries which fail, or which exceed their expected execution time, will be logged for potential further analysis.
  • Debug logging of queries may be enabled globally, or restricted to particular sets of queries.
  • Simple syntax for iterating through a result set.
See http://wiki.davical.org/w/AwlDatabase for design and usage information.

If not already connected, AwlDatabase will attempt to connect to the database, successively applying connection parameters from the array in $c->pdo_connect.

We will die if the database is not currently connected and we fail to find a working connection.

Classes
Class Description
 class AwlDatabase Typically there will only be a single instance of the database level class in an application.
Includes
 require_once ('AwlDBDialect.php') (line 37)

Documentation generated on Fri, 13 Jan 2012 23:40:12 +1300 by phpDocumentor 1.4.3