mirror of https://gitee.com/bigwinds/arangodb
Added a convenience function to add a collection by name at Runtime to transaction
This commit is contained in:
parent
7113e93c67
commit
93efb73ca7
|
@ -797,6 +797,19 @@ OperationResult Transaction::anyLocal(std::string const& collectionName,
|
|||
TRI_ERROR_NO_ERROR, false);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief add a collection to the transaction for read, at runtime
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Transaction::addCollectionAtRuntime(std::string const& collectionName) {
|
||||
|
||||
auto cid = resolver()->getCollectionId(collectionName);
|
||||
if (cid == 0) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
}
|
||||
addCollectionAtRuntime(cid);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return the type of a collection
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -287,7 +287,11 @@ class Transaction {
|
|||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief add a collection to the transaction for read, at runtime
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void addCollectionAtRuntime(std::string const& collectionName);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return the type of a collection
|
||||
|
|
Loading…
Reference in New Issue