for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
namespace Spiral\Database\Drivers\Postgres;
use Spiral\Database\Entities\QueryCompiler as AbstractCompiler;
* Postgres syntax specific compiler.
class PostgresCompiler extends AbstractCompiler
{
* {@inheritdoc}
public function compileInsert(
string $table,
array $columns,
array $rowsets,
string $primaryKey = ''
): string {
return parent::compileInsert(
$table,
$columns,
$rowsets
) . (!empty($primaryKey) ? ' RETURNING ' . $this->quote($primaryKey) : '');
}
protected function compileDistinct($distinct): string
if (empty($distinct)) {
return '';
return 'DISTINCT' . (is_string($distinct) ? '(' . $this->quote($distinct) . ')' : '');