NAME

DBIx::Class::Storage::DBI - DBI storage handler

SYNOPSIS

DESCRIPTION

This class represents the connection to the database

METHODS

on_connect_do

Executes the sql statements given as a listref on every db connect.

debug

Causes SQL trace information to be emitted on debugfh filehandle (or STDERR if debugfh has not specifically been set).

debugfh

Sets or retrieves the filehandle used for trace/debug output. This should be an IO::Handle compatible object (only the print method is used). Initially set to be STDERR - although see information on the DBIX_CLASS_STORAGE_DBI_DEBUG environment variable.

debugcb

Sets a callback to be executed each time a statement is run; takes a sub reference. Overrides debugfh. Callback is executed as $sub->($op, $info) where $op is SELECT/INSERT/UPDATE/DELETE and $info is what would normally be printed.

txn_begin

Calls begin_work on the current dbh.

See DBIx::Class::Schema for the txn_do() method, which allows for an entire code block to be executed transactionally.

txn_commit

Issues a commit against the current dbh.

txn_rollback

Issues a rollback against the current dbh. A nested rollback will throw a DBIx::Class::Storage::NESTED_ROLLBACK_EXCEPTION exception, which allows the rollback to propagate to the outermost transaction.

columns_info_for

Returns database type info for a given table columns.

ENVIRONMENT VARIABLES

DBIX_CLASS_STORAGE_DBI_DEBUG

If DBIX_CLASS_STORAGE_DBI_DEBUG is set then SQL trace information is produced (as when the debug method is set).

If the value is of the form 1=/path/name then the trace output is written to the file /path/name.

AUTHORS

Matt S. Trout <mst@shadowcatsystems.co.uk>

Andy Grundman <andy@hybridized.org>

LICENSE

You may distribute this code under the same terms as Perl itself.