auraphp/Aura.Sql — Issue #7: lastInsertId()
Author: harikt
Created: 2012-02-05 04:44:28+00:00
State: open

I was looking into the method `lastInsertId` ,

Postgres have a different way and I am not sure MSSQL has something different too for I don't remember or used it recently .

I feel the method `public function lastInsertId($table = '' , $col = '' )` can be moved to `AbstractDriver.php` , so we don't repeat the same method in `Mysql.php` https://github.com/auraphp/Aura.Sql/blob/master/src/Aura/Sql/Driver/Mysql.php#L162 and `Sqlite.php` https://github.com/auraphp/Aura.Sql/blob/master/src/Aura/Sql/Driver/Sqlite.php#L228 .

public function lastInsertId($table = '' , $col = '' )
{
$pdo = $this->getPdo();
return $pdo->lastInsertId();
}

And we can override it from `Pgsql.php` https://github.com/auraphp/Aura.Sql/blob/master/src/Aura/Sql/Driver/Pgsql.php#L234 in the same fashion. Do you think its a good way ?