improve / fix postgres support.

This commit is contained in:
Taylor Otwell
2012-05-30 14:23:27 -05:00
parent 56c6202d28
commit 691d68ba54
8 changed files with 73 additions and 11 deletions

View File

@@ -89,6 +89,9 @@ class Connection {
case 'sqlsrv':
return $this->grammar = new Query\Grammars\SQLServer($this);
case 'pgsql':
return $this->grammar = new Query\Grammars\Postgres($this);
default:
return $this->grammar = new Query\Grammars\Grammar($this);
}
@@ -190,6 +193,13 @@ class Connection {
{
return $statement->rowCount();
}
// For insert statements that use the "returning" clause, which is allowed
// by databsae systems such as Postgres, we need to actually return the
// real query result so the consumer can get the ID.
elseif (stripos($sql, 'insert') === 0 and stripos($sql, 'returning') !== false)
{
return $this->fetch($statement, Config::get('database.fetch'));
}
else
{
return $result;