0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 12:48:54 +02:00

ircd::db: Util to flush all columns in db.

This commit is contained in:
Jason Volk 2018-03-22 19:41:50 -07:00
parent cbfb105765
commit 421f2f5220
2 changed files with 11 additions and 0 deletions

View file

@ -20,6 +20,7 @@ namespace ircd::db
const std::string &name(const database &); const std::string &name(const database &);
uint64_t sequence(const database &); // Latest sequence number uint64_t sequence(const database &); // Latest sequence number
void flush(database &, const bool &blocking = true);
void sync(database &); void sync(database &);
} }

View file

@ -122,6 +122,16 @@ ircd::db::sync(database &d)
}; };
} }
/// Flushes all columns. Note that if blocking=true, blocking may occur for
/// each column individually.
void
ircd::db::flush(database &d,
const bool &blocking)
{
for(const auto &column : d.columns)
flush(*column, blocking);
}
uint64_t uint64_t
ircd::db::sequence(const database &cd) ircd::db::sequence(const database &cd)
{ {