Skip to content

Helpers::dumpSql() should parse named params - #78

Open
insekticid wants to merge 1 commit into
nette:masterfrom
insekticid:issue-77
Open

Helpers::dumpSql() should parse named params#78
insekticid wants to merge 1 commit into
nette:masterfrom
insekticid:issue-77

Conversation

@insekticid

Copy link
Copy Markdown
Contributor

In PDO you can bind named params bindValue('something', 1, PDO::TYPE);

So you can use ResultSet like this

$query = 'SELECT * FROM table WHERE id = :something';
$params[':something'] = 1;
$resultSet = new ResultSet($connection, $query, $params);
$connection->onQuery($connection, $resultSet);// log binded param query to Tracy

Problem is in Nette\Bridges\DatabaseTracy\ConnectionPanel template which invoke Helpers::dumpSql()

This helper does not support named parameters. Tracy result is:

SELECT * FROM table WHERE id = :something

Expected

SELECT * FROM table WHERE id = 1

@insekticid insekticid changed the title Helpers::dumpSql() should parse named params #77 Helpers::dumpSql() should parse named params #78 Jul 15, 2015
@insekticid insekticid changed the title Helpers::dumpSql() should parse named params #78 Helpers::dumpSql() should parse named params Jul 15, 2015
@dg
dg force-pushed the master branch 3 times, most recently from 6c43c50 to 6690dde 比较 November 5, 2015 00:42
@dg
dg force-pushed the master branch 4 times, most recently from 0771c2f to 425ad23 比较 April 21, 2016 13:03
@dg
dg force-pushed the master branch 2 times, most recently from 59a6661 to b660054 比较 May 30, 2016 14:28
@dg
dg force-pushed the master branch 2 times, most recently from 5c87d56 to d9fd67a 比较 June 27, 2016 23:11
@dg
dg force-pushed the master branch 11 times, most recently from 221f038 to 276f489 比较 October 18, 2016 12:35
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant