catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

"Dump and Die" - debugging #1066

Open Cristianpl4y opened 1 year ago

Cristianpl4y commented 1 year ago

Hello, I just found out that one of the systems where I work uses medoo, searching the documentation I didn't find a method that makes it easy to view variables in the browser.

Not that this is a problem because we can use var_dump() and print_r().

Would it be possible to create an easy native method?

Example: Laravel has a specific short helper function to show variables - ​dd()

similar to debug(), but instead of displaying the SQL, it retrieves the contents of the query.

catfan commented 1 year ago

We have debug() for a query, beginDebug() and bebugLog() for debug logging.

And logging connection option for log() to log all queries.

And testMode for testing queries.

https://medoo.in/api/new https://medoo.in/api/log https://medoo.in/api/debug

Cristianpl4y commented 1 year ago

Temos debug()para uma consulta beginDebug()e bebugLog()para log de depuração.

E opção de conexão log()de registro para registrar todas as consultas.

E testMode para testar consultas.

https://medoo.in/api/new https://medoo.in/api/log https://medoo.in/api/debug

They are great resources 😅, I think you didn't understand my suggestion very well 😕, I missed a method that shows the data returned from the queries.