diff options
Diffstat (limited to 'bpkg/diagnostics')
-rw-r--r-- | bpkg/diagnostics | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bpkg/diagnostics b/bpkg/diagnostics index f403d9f..e48d4f2 100644 --- a/bpkg/diagnostics +++ b/bpkg/diagnostics @@ -13,6 +13,8 @@ #include <ostream> #include <exception> +#include <odb/tracer.hxx> + #include <bpkg/types> namespace bpkg @@ -320,11 +322,25 @@ namespace bpkg // trace // - struct trace_mark_base: basic_mark_base + // Also implement the ODB tracer interface so that we can use + // it to trace database statement execution. + // + struct trace_mark_base: basic_mark_base, odb::tracer { explicit trace_mark_base (const char* name, const void* data = nullptr) : basic_mark_base ("trace", name, data) {} + + // odb::tracer interface. + // + virtual void + prepare (odb::connection&, const odb::statement&); + + virtual void + execute (odb::connection&, const char* statement); + + virtual void + deallocate (odb::connection&, const odb::statement&); }; typedef diag_mark<trace_mark_base> trace_mark; |