GX::Database

Module Version: 0.2000_01

NAME

GX::Database - Base class for database components

SYNOPSIS

None.

DESCRIPTION

This module provides the GX::Database class which extends the GX::Component::Singleton class.

METHODS

Constructor

new

Returns the database component instance.

$database = $database_class->new;
Returns:
Exceptions:

Public Methods

All public methods can be called both as instance and class methods.

connect

Returns a new or, if available, cached DBI database handle.

$dbh = $database->connect;
Returns:
  • $dbh ( DBI::db object )
Exceptions:

connect_options

Returns any additional, user-specified options that are passed to DBI's connect() method when connect() is called.

%options = $database->connect_options;
Returns:
  • %options ( named list )

dbh

An alias for connect().

$dbh = $database->dbh;

disconnect

Disconnects the database.

$database->disconnect;

dsn

Returns the full data source name (DSN) that is passed to DBI's connect() method when connect() is called.

$dsn = $database->dsn;
Returns:
  • $dsn ( string )

is_connected

Returns true if the database is connected, otherwise false.

$result = $database->is_connected;
Returns:
  • $result ( bool )

setup

Sets up the database component.

$database_class->setup( %options );
Options:
  • %options ( named list )
Exceptions:

sql_builder

Returns the associated SQL builder.

$sql_builder = $database->sql_builder;
Returns:

SUBCLASSES

The following classes inherit directly from GX::Database:

SEE ALSO

AUTHOR

Jörg A. Uzarek <uzarek@runlevelnull.de>

COPYRIGHT AND LICENSE

Copyright © 2009-2011 Jörg A. Uzarek.

This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.