Commit 051077c6 authored by zYne's avatar zYne

Sqlite driver updated

parent dcc59843
...@@ -24,7 +24,10 @@ Doctrine::autoload("Doctrine_Connection_Common"); ...@@ -24,7 +24,10 @@ Doctrine::autoload("Doctrine_Connection_Common");
* *
* @package Doctrine ORM * @package Doctrine ORM
* @url www.phpdoctrine.com * @url www.phpdoctrine.com
* @license LGPL * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Id$
*/ */
class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common { class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common {
...@@ -96,6 +99,18 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common { ...@@ -96,6 +99,18 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common {
$query = "PRAGMA read_uncommitted=$isolation"; $query = "PRAGMA read_uncommitted=$isolation";
return $this->_doQuery($query, true); return $this->_doQuery($query, true);
} }
/**
* Returns the current id of a sequence
*
* @param string $seq_name name of the sequence
* @return integer the current id in the given sequence
*/
public function currId($sequence) {
$sequence = $this->quoteIdentifier($sequence, true);
$seqColumn = $this->quoteIdentifier($this->options['seqcol_name'], true);
$stmt = $this->dbh->query('SELECT MAX(' . $seqColumn . ') FROM ' . $sequence);
$data = $stmt->fetch(PDO::FETCH_NUM);
return $data[0];
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment