Skip to content

Commit

Permalink
Added Connection::quoteId
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusakov Nikita committed May 5, 2014
1 parent f0b5559 commit 4f0404d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ public function query($sql, array $parameters = [])
return $this->prepare($sql)->execute($parameters);
}

/**
* @param string $id
*
* @return string
*/
public function quoteId($id)
{
return $this->grammar->buildId($id);
}

/**
* @return static
*/
Expand Down
5 changes: 5 additions & 0 deletions tests/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public function testQuery()
$this->assertAttributeSame(['id' => \PDO::PARAM_INT], 'types', $stmt);
}

public function testQuoteId()
{
$this->assertSame('"id"', $this->connection->quoteId('id'));
}

public function testSelect()
{
$select = $this->connection->select('id', 'name', 'count');
Expand Down

0 comments on commit 4f0404d

Please sign in to comment.