Debugging DB queries with the ORM changes introduced in 3.2 became more difficult. Running $dataList->sql()
gives you the prepared statement (in form of SELECT * FROM Table WHERE Title = ?
) which is a good start. ?showqueries
URL variable does the same.
How to get the values, or parameters, of the statement is what I'm interested in. I'm aware of https://github.com/lekoala/silverstripe-debugbar but I'd like to know if there's a way to get them without any extensions in XDebug console (or just by var_dump
:ing something).
I looked quickly through the code of silverstripe-debugbar but didn't find an easily usable solution. If it is there somewhere please point me to it :)