// file : bpkg/database -*- C++ -*- // copyright : Copyright (c) 2014-2015 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef BPKG_DATABASE #define BPKG_DATABASE #include #include #include namespace bpkg { using odb::sqlite::database; using odb::sqlite::transaction; database open (const dir_path& configuration, tracer&, bool create = false); struct tracer_guard { tracer_guard (database& db, tracer& t) : db_ (db), t_ (db.tracer ()) {db.tracer (t);} ~tracer_guard () {db_.tracer (*t_);} private: database& db_; odb::tracer* t_; }; } #endif // BPKG_DATABASE