improve / fix postgres support.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user