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:
parent
cbfb105765
commit
421f2f5220
2 changed files with 11 additions and 0 deletions
|
@ -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 &);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
ircd/db.cc
10
ircd/db.cc
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue