sailorproject / sailor

A Lua MVC Web Framework.
MIT License
921 stars 125 forks source link

feat(db): added support for query logging #148

Closed soapdog closed 5 years ago

soapdog commented 7 years ago

Adds support for database query logging for debugging purposes.

If the database configuration has log_database_queries = true then a file called runtime/logs/query.log is appended with the SQL queries issued from Sailor Models. At this point only the SQL queries are recorded, result values and location of the queries might be added in the future.

Changes were made to the db folder, the blank app and the configuration template.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-69.4%) to 13.263% when pulling 9a8534ea611522c51b3c36e44b9263d9a79d47a3 on soapdog:b-enhancement-database-query-log into 2aa102692038ba93554f3a7c984d9b8ec19d8d51 on sailorproject:master.

Etiene commented 7 years ago

Awesome! Tests are failing on Lua 5.2 though, could you take a look at that? :) https://travis-ci.org/sailorproject/sailor/builds/201879964

soapdog commented 7 years ago

@Etiene just took a quick look, apparently sailor.path is resolving to nil on Lua 5.2, will look further into it.

Etiene commented 7 years ago

Hello @soapdog any updates? :)

soapdog commented 7 years ago

@Etiene I am swamped in work this week. I will update this next week, on Monday, when I am a normal human being again. 😄

Etiene commented 5 years ago

closing due to inactivity