Skip to content

Commit 4f0404d

Browse files
author
Gusakov Nikita
committed
Added Connection::quoteId
1 parent f0b5559 commit 4f0404d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Connection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ public function query($sql, array $parameters = [])
9696
return $this->prepare($sql)->execute($parameters);
9797
}
9898

99+
/**
100+
* @param string $id
101+
*
102+
* @return string
103+
*/
104+
public function quoteId($id)
105+
{
106+
return $this->grammar->buildId($id);
107+
}
108+
99109
/**
100110
* @return static
101111
*/

tests/ConnectionTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public function testQuery()
9494
$this->assertAttributeSame(['id' => \PDO::PARAM_INT], 'types', $stmt);
9595
}
9696

97+
public function testQuoteId()
98+
{
99+
$this->assertSame('"id"', $this->connection->quoteId('id'));
100+
}
101+
97102
public function testSelect()
98103
{
99104
$select = $this->connection->select('id', 'name', 'count');

0 commit comments

Comments
 (0)