1
0
Fork 0

Added a convenience function to add a collection by name at Runtime to transaction

This commit is contained in:
Michael Hackstein 2016-03-16 11:09:42 +01:00
parent 7113e93c67
commit 93efb73ca7
2 changed files with 17 additions and 0 deletions

View File

@ -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
//////////////////////////////////////////////////////////////////////////////

View File

@ -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