Skip to content
Snippets Groups Projects
Commit 62c0ced5 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

Merge branch 'dev' into f-full-c

parents ccf20764 4319b3dd
No related branches found
No related tags found
1 merge request!15ENH: Allow insert/update/delete and files in Extern C
Pipeline #12500 failed
......@@ -91,6 +91,8 @@ test:
- cmake -DCMAKE_BUILD_TYPE=Debug ..
- cmake --build . -j
- cmake --build . -j --target unit_test_coverage
- cmake --build . -j --target cxxcaosdbcli
- cmake --build . -j --target ccaosdbcli
# trigger the integration tests
trigger_inttest:
......
......@@ -83,6 +83,7 @@ bool UnaryRpcHandler::OnNext(bool ok) {
// with the fail-fast option. (Note that async unary RPCs don't post a CQ
// tag at this point, nor do client-streaming or bidi-streaming RPCs that
// have the initial metadata corked option set.)"
return false;
}
return true;
......
......@@ -26,7 +26,7 @@
#include "caosdb/entity.h" // for Entity
#include "caosdb/exceptions.h" // for ConfigurationError
#include "caosdb/info.h" // for VersionInfo
#include "caosdb/transaction.h" // for Transaction, UniqueResult, ResultSet
#include "caosdb/transaction.h" // for Transaction, ResultSet
#include <iostream> // for operator<<, basic_ostream, basic_ost...
#include <memory> // for unique_ptr, allocator, __shared_ptr_...
#include <string> // for operator<<, char_traits
......@@ -50,17 +50,29 @@ auto main() -> int {
// retrieve an entity
auto transaction(connection->CreateTransaction());
transaction->RetrieveById("20");
transaction->RetrieveById("120");
transaction->Execute();
const auto &result_set =
dynamic_cast<const caosdb::transaction::UniqueResult &>(transaction->GetResultSet());
const auto &result_set = transaction->GetResultSet();
// print description
std::cout << "Entity Description: " << result_set.GetEntity().GetDescription() << std::endl;
// print information
const auto &ent = result_set.at(0);
const auto &props = ent.GetProperties();
std::cout << "Entity Name: " << ent.GetName() << std::endl;
std::cout << "Entity Description: " << ent.GetDescription() << std::endl;
std::cout << "Entity Properties: " << std::endl;
for (const auto &prop : props) {
std::cout << "----------\n" << prop.ToString() << std::endl;
}
return 0;
} catch (const caosdb::exceptions::ConfigurationError &exc) {
std::cout << "ConfigurationError: " << exc.what() << std::endl;
return exc.GetCode();
} catch (const std::exception& exc) {
std::cout << "Exception: " << exc.what() << std::endl;
return 1;
} catch (...) {
std::cout << "Some other exception." << std::endl;
return 2;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment