simplified database connection configuration.

This commit is contained in:
Taylor Otwell
2011-09-12 23:14:24 -05:00
parent 045858d88d
commit 59a7e47f82
14 changed files with 98 additions and 331 deletions

View File

@@ -0,0 +1,22 @@
<?php namespace Laravel\Database\Queries;
use PDO;
class Postgres extends Query {
/**
* Insert an array of values into the database table and return the value of the ID column.
*
* @param array $values
* @return int
*/
public function insert_get_id($values)
{
$query = $this->connection->pdo->prepare($this->grammar->insert_get_id($this, $values));
$query->execute(array_values($values));
return (int) $query->fetch(PDO::FETCH_CLASS, 'stdClass')->id;
}
}