DBIx:: StORM

Summary
A StORM class representing a database connection.
The version of this package.
Used to set the level of debug messages output by the DBIx::StORM framework.
Create a new DBIx::StORM object and open a connection to the database using DBI.
Add an inflater to the inflation chain for this connection.
Returns all the inflaters registered on this connection.
Fetch a table object using this database connection.
Fetch a tied hash map of table name to DBIx::StORM::Table objects.
Fetch the underlying DBI database handle.
Add a hint to the key parsing system.
Write a debugging message to STDERR if the debug level is high enough to warrant showing this message.
Fetch the database driver used to perform database-specific functions and optimisations for this connection.

DBIx:: StORM

A StORM class representing a database connection.

This is essentially a wrapper for a DBI connection.  This object can be dereferenced as a hash, with the keys of the hash being the table names present in this database and the values being DBIx::StORM::Table objects.

Any methods not used by this class will be passed to the underlying DBI connection object, so you can call most DBI methods directly on this object.

=end NaturalDocs

Summary
The version of this package.
Used to set the level of debug messages output by the DBIx::StORM framework.
Create a new DBIx::StORM object and open a connection to the database using DBI.
Add an inflater to the inflation chain for this connection.
Returns all the inflaters registered on this connection.
Fetch a table object using this database connection.
Fetch a tied hash map of table name to DBIx::StORM::Table objects.
Fetch the underlying DBI database handle.
Add a hint to the key parsing system.
Write a debugging message to STDERR if the debug level is high enough to warrant showing this message.
Fetch the database driver used to perform database-specific functions and optimisations for this connection.

Variables

$VERSION (public static)

The version of this package.

=end NaturalDocs

$DEBUG (public static)

Used to set the level of debug messages output by the DBIx::StORM framework.  Useful values are:

0never output messages
1output important messages, including those that seriously hurt performance
2output useful messages that can explain how the system understands your code and what SQL is being executed
3output even more messages; useful for internal debugging

=end NaturalDocs

Functions

connect (public static)

Create a new DBIx::StORM object and open a connection to the database using DBI.

Parameters

String $dsnThe DBI DSN string or a DBI::db object
String $userDatabase username (if $dsn is a string)
String $passwordDatabase password (if $dsn is a string)

Returns

ObjectA new DBIx::StORM object

=end NaturalDocs

Variables

$dbh

my $dbh

$drivername

my $drivername

Functions

inflater (public instance)

Add an inflater to the inflation chain for this connection.  The inflater should be a subclass a DBIx::StORM::Inflater.

Parameters

Object $infThe inflater object

Returns

Nothing

=end NaturalDocs

_inflaters (private instance)

Returns all the inflaters registered on this connection.

Parameters

None

Returns

ListList of DBIx::StORM::Inflater objects

=end NaturalDocs

get (public instance)

Fetch a table object using this database connection.

Parameters

String $table_nameThe name of the table to open
Boolean $skip_verifyWhether to skip checking for table existence

Returns

ObjectA table object of class DBIx::StORM::Table

=end NaturalDocs

_as_tied_hash (private instance)

Fetch a tied hash map of table name to DBIx::StORM::Table objects.

Parameters

None

Returns

HashA map of string table names to DBIx::StORM::Table objects.  This is a tied hash of class DBIx::StORM::TiedTable and uses lazy lookup

=end NaturalDocs

dbi (public instance)

Fetch the underlying DBI database handle.

Parameters

None

Returns

ObjectA scalar database handle of class DBI::db

=end NaturalDocs

add_hint (public instance)

Add a hint to the key parsing system.

The following hints are supported by all systems

  • primary_key => “tableName->fieldName”
  • foreign_key => { “fromTable->field” => “toTable->field” }

Parameters

String $hint_typea string describing the type of hint
String $hint_valuethe hint itself.  The format depends on the <$hint_type>

Returns

Nothing

=end NaturalDocs

_debug (private static/ instance)

Write a debugging message to STDERR if the debug level is high enough to warrant showing this message.

Parameters

Integer $levelan integer showing the level of this message.  A higher number means the message is less likely to be shown
List @messagesThe message string(s) to be written to STDERR

Returns

Nothing

=end NaturalDocs

_sqldriver (private instance)

Fetch the database driver used to perform database-specific functions and optimisations for this connection.  This is used internally for other objects to be able to directly invoke database calls.

Parameters

None

Returns

Objectan instance of DBIx::StORM::SQLDriver

=end NaturalDocs

my $dbh
my $drivername