mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 22:26:43 +02:00
* added dibi::date & dibi::datetime
* DibiConnection::insertId && affectedRows throws exception on failure * added protected throwException() to drivers * DibiPostgreDriver - can build connection string * DibiSqliteDriver - support for parameters 'format:date' & 'format:datetime' * fixed query errors in DibiSqliteDriver * DibiConnection prevents serialization and multiple transactions
This commit is contained in:
@@ -121,7 +121,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
/**
|
||||
* Gets the number of affected rows by the last INSERT, UPDATE or DELETE query
|
||||
*
|
||||
* @return int number of rows or FALSE on error
|
||||
* @return int|FALSE number of rows or FALSE on error
|
||||
*/
|
||||
public function affectedRows()
|
||||
{
|
||||
@@ -145,6 +145,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
/**
|
||||
* Begins a transaction (if supported).
|
||||
* @return void
|
||||
* @throws DibiDriverException
|
||||
*/
|
||||
public function begin()
|
||||
{
|
||||
@@ -156,6 +157,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
/**
|
||||
* Commits statements in a transaction.
|
||||
* @return void
|
||||
* @throws DibiDriverException
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
@@ -167,6 +169,7 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
/**
|
||||
* Rollback changes in a transaction.
|
||||
* @return void
|
||||
* @throws DibiDriverException
|
||||
*/
|
||||
public function rollback()
|
||||
{
|
||||
@@ -316,6 +319,19 @@ class DibiMsSqlDriver extends NObject implements DibiDriverInterface
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Converts database error to DibiDriverException
|
||||
*
|
||||
* @throws DibiDriverException
|
||||
*/
|
||||
protected function throwException($sql=NULL)
|
||||
{
|
||||
throw new DibiDriverException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the connection resource
|
||||
*
|
||||
|
Reference in New Issue
Block a user