Download the PHP package forrest79/phpgsql-nette without Composer
On this page you can find all versions of the php package forrest79/phpgsql-nette. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phpgsql-nette
PhPgSql - Tracy
Use PhPgSql with Tracy from Nette Framework.
Introduction
Tracy bar panel to show queries executed in your database and bluescreen extension to show failed database query.
Installation
The recommended way to install PhPgSql - Tracy is through Composer:
Using
Bar panel
Bar panel will show all queries executed in your database. You copy query to the clipboard, mark long run queries, mark repeated queries, show notices and non parsed columns.
You can add the panel for each database connection:
- bar can be disabled with
disable()method
$backtraceContinueIterate parameter
Panel is showing links to the PHP source files, where the query was executed. This is made using PHP function debug_backtrace().
This function returns the whole call stack. To get the correct place in the PHP source file, we must ignore some internal library classes where the query
is really executed and iterated up to the user code, that run this execution.
Basically, BarPanel ignores all classes/function from PhPgSql library to show the most accurate place in the PHP source.
When you use some own custom wrapping objects, you want to ignore it in the call stack as well. You can some callable and pass it to the $backtraceContinueIterate Parameter. For example:
Bluescreen
Bluescreen should be registered just once (it doesn't matter how many DB connections you have):
With this, when some Forrest79\PhPgSql\Db\Exceptions\QueryException is thrown, you will see the SQL query and the parameters (and the SQL query with the parameters) on your BlueScreen.
Query dumper
SQL queries are dumped in Tracy\Bar and in Tracy\BlueScreen and you can use different dumpers/formatters. Three are included:
PhPgSql\Tracy\QueryDumpers\NullDumper- show SQL query as it isPhPgSql\Tracy\QueryDumpers\Basic- highlight and format SQL query with basic internal formatterPhPgSql\Tracy\QueryDumpers\SqlFormatter- highlight and format SQL query with Doctrine\Sql-Formatter,Doctrine\Sql-Formattermust be is installed (composer require doctrine/sql-formatter --dev)
Or you can use your own query dumper, just create a class-extending abstract class PhPgSql\Tracy\QueryDumper.