diff --git a/include/ircd/db/column.h b/include/ircd/db/column.h index 592203b3c..5db6d3e06 100644 --- a/include/ircd/db/column.h +++ b/include/ircd/db/column.h @@ -23,10 +23,12 @@ namespace ircd::db size_t bytes(const column &); // Get property data of a db column. R can optionally be uint64_t for some - // values. Refer to RocksDB documentation for more info. - template R property(const column &, const string_view &name); - template<> std::string property(const column &, const string_view &name); - template<> uint64_t property(const column &, const string_view &name); + // values; we typedef that as prop_int for templating purposes. R can also + // be an std::string which we typedef as prop_str. Refer to RocksDB + // documentation for more info. + template R property(const column &, const string_view &name); + template<> prop_str property(const column &, const string_view &name); + template<> prop_int property(const column &, const string_view &name); // [GET] Tests if key exists bool has(column &, const string_view &key, const gopts & = {}); diff --git a/include/ircd/db/database/database.h b/include/ircd/db/database/database.h index d92485cda..611783187 100644 --- a/include/ircd/db/database/database.h +++ b/include/ircd/db/database/database.h @@ -15,11 +15,17 @@ namespace ircd::db { struct database; - template R property(const database &, const string_view &name); - template<> uint64_t property(const database &, const string_view &name); + // General information const std::string &name(const database &); uint64_t sequence(const database &); // Latest sequence number + // Property information interface + using prop_int = uint64_t; + using prop_str = std::string; + template R property(const database &, const string_view &name); + template<> prop_int property(const database &, const string_view &name); + + // Control panel void checkpoint(database &, const string_view &dir); void flush(database &, const bool &blocking = true); void sync(database &); diff --git a/ircd/db.cc b/ircd/db.cc index 5258fdd1e..412942a46 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -172,7 +172,7 @@ ircd::db::sequence(const database &cd) } template<> -uint64_t +ircd::db::prop_int ircd::db::property(const database &cd, const string_view &name) { @@ -3588,7 +3588,7 @@ ircd::db::read(column &column, } template<> -std::string +ircd::db::prop_str ircd::db::property(const column &column, const string_view &name) { @@ -3600,7 +3600,7 @@ ircd::db::property(const column &column, } template<> -uint64_t +ircd::db::prop_int ircd::db::property(const column &column, const string_view &name) {