mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 18:18:56 +02:00
ircd::db: Add txn ctor claiming a rocksdb::WriteBatch.
This commit is contained in:
parent
d40b18633f
commit
2671f4eb90
|
@ -21,7 +21,7 @@ namespace ircd::db
|
|||
std::string debug(const txn &);
|
||||
}
|
||||
|
||||
class ircd::db::txn
|
||||
struct ircd::db::txn
|
||||
{
|
||||
database *d {nullptr};
|
||||
std::unique_ptr<rocksdb::WriteBatch> wb;
|
||||
|
@ -59,6 +59,7 @@ class ircd::db::txn
|
|||
txn() = default;
|
||||
txn(database &);
|
||||
txn(database &, const opts &);
|
||||
txn(database &, std::unique_ptr<rocksdb::WriteBatch> &&);
|
||||
~txn() noexcept;
|
||||
};
|
||||
|
||||
|
|
|
@ -2425,7 +2425,7 @@ noexcept
|
|||
//
|
||||
|
||||
ircd::db::txn::txn(database &d)
|
||||
:txn{d, {}}
|
||||
:txn{d, opts{}}
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -2439,6 +2439,13 @@ ircd::db::txn::txn(database &d,
|
|||
{
|
||||
}
|
||||
|
||||
ircd::db::txn::txn(database &d,
|
||||
std::unique_ptr<rocksdb::WriteBatch> &&wb)
|
||||
:d{&d}
|
||||
,wb{std::move(wb)}
|
||||
{
|
||||
}
|
||||
|
||||
ircd::db::txn::~txn()
|
||||
noexcept
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue