Class | DBI::DatabaseHandle |
In: |
lib/dbi/handles/database.rb
|
Parent: | Handle |
DatabaseHandle is the interface the consumer sees after connecting to the database via DBI.connect.
It is strongly discouraged that DBDs inherit from this class directly; please inherit from the DBI::BaseDatabase instead.
Note: almost all methods in this class will raise InterfaceError if the database is not connected.
last_statement | [RW] | |
raise_error | [RW] |
Returns the columns of the provided table as an array of ColumnInfo objects. See BaseDatabase#columns for the minimum parameters that this method must provide.
Disconnect from the database. Will raise InterfaceError if this was already done prior.
Perform a statement. This goes straight to the DBD‘s implementation of do (and consequently, BaseDatabase#do), and does not work like execute and prepare. Should return a row modified count.
This is the driver name as supplied by the DBD‘s driver_name method. Its primary utility is in DBI::TypeUtil#convert.
Assign the driver name. This can be leveraged to create custom type management via DBI::TypeUtil#convert.
Attempt to establish if the database is still connected. While connected? returns the state the DatabaseHandle thinks is true, this is an active operation that will contact the database.
Prepare a StatementHandle and return it. If given a block, it will supply that StatementHandle as the first argument to the block, and BaseStatement#finish it when the block is done executing.
Executes a statement and returns all rows from the result. If a block is given, it is executed for each row.
Commits, runs the block provided, yielding the DatabaseHandle as it‘s argument. If an exception is raised through the block, rollback occurs. Otherwise, commit occurs.