ePages 6.11.0 - DE_EPAGES/Database/API/DBISQLite.pm

Package DE_EPAGES::Database::API::DBISQLite

central database interface for sqlite databases.

Base
DE_EPAGES::Database::API::DBI

Functions

disconnect
do
dropIndex
existsIndex
transaction

disconnect

Disconnects the underlying database handle.

Syntax
$dbi->disconnect;

do

Executes the given statement and logs it via DE_EPAGES::Database::API::DBI::logTransaction.

Input
$SQL (string)
SQL statement
$aParams (ref.array.*)
list of parameters to replace '?' placeholders in the SQL
string
$aTypes (ref.array.string)
list of parameters types

dropIndex

Drops index $indexname from table $tablename.

Syntax
$dbi->dropIndex($table, $indexname);
Example
$dbi->dropIndex('product', 'i_product_super');
Input
$table (string)
table name
$indexname (string)
index name

existsIndex

Returns true if the index exists.

Syntax
$exists = $dbi->existsIndex($Table, $IndexName);
Example
if( $dbi->existsIndex('product', 'i_product_super') ) { ... }
Input
$Table (string)
table name
$IndexName (string)
index name

transaction

Executes a code block in a transaction.

Syntax
$dbi->transaction( $cCode, $cRollback );
Example
$dbi->transaction( sub {
    $dbi->do( "DELETE FROM objects WHERE classid = 25" );
    $dbi->do( "DELETE FROM classes WHERE classid = 25" );
} );
Input
$cCode (code reference)
code block
$cRollback (code reference)
roll back code block (optional)