Ticket #608 (closed defect: fixed)
SQL Profiling improvements
| Reported by: | alex94040 | Owned by: | |
|---|---|---|---|
| Priority: | important | Milestone: | 2.0.2 Stable |
| Component: | Database adapter | Version: | 2.0 HEAD |
| Keywords: | Cc: |
Description (last modified by alex94040) (diff)
Intention:
1) Refactor the database adapters in such a way that it'd be easy to inject new kinds of logging. Side effect: none of the adapters now don't have to do a silly "check if not connected and connect!" in every other method.
2) Add time-based logging using QTimer (how long does each query take)
Based on the qcodo code from klucznik (see http://qcu.be/content/my-modifications-and-improvements-qcodo)
Note that this BREAKS compatibility with old database adapters (those that are not included in the core), but in a very straighforward, simple way:
1) Rename Query() to ExecuteQuery() and make it protected. Same with NonQuery?() - rename it to ExecuteNonQuery()
2) Remove all calls to LogQuery() and checks to see if connected (that stuff is done automatically at the base class level).
