Skip to content
Snippets Groups Projects

ENH: Allow insert/update/delete and files in Extern C

Merged Florian Spreckelsen requested to merge f-full-c into dev
1 file
+ 38
0
Compare changes
  • Side-by-side
  • Inline
+ 38
0
@@ -461,6 +461,44 @@ ERROR_RETURN_CODE(GENERIC_ERROR,
return wrapped_transaction->Query(std::string(query));
})
ERROR_RETURN_CODE(
GENERIC_ERROR,
int caosdb_transaction_transaction_insert_entity(
caosdb_transaction_transaction *transaction, caosdb_entity_entity *entity),
{
auto *wrapped_transaction = static_cast<caosdb::transaction::Transaction *>(
transaction->wrapped_transaction);
auto *wrapped_entity =
static_cast<caosdb::entity::Entity *>(entity->wrapped_entity);
return wrapped_transaction->InsertEntity(*wrapped_entity);
})
ERROR_RETURN_CODE(
GENERIC_ERROR,
int caosdb_transaction_transaction_update_entity(
caosdb_transaction_transaction *transaction, caosdb_entity_entity *entity),
{
auto *wrapped_transaction = static_cast<caosdb::transaction::Transaction *>(
transaction->wrapped_transaction);
auto *wrapped_entity =
static_cast<caosdb::entity::Entity *>(entity->wrapped_entity);
return wrapped_transaction->UpdateEntity(*wrapped_entity);
})
ERROR_RETURN_CODE(GENERIC_ERROR,
int caosdb_transaction_transaction_delete_by_id(
caosdb_transaction_transaction *transaction,
const char *id),
{
auto *wrapped_transaction =
static_cast<caosdb::transaction::Transaction *>(
transaction->wrapped_transaction);
return wrapped_transaction->DeleteById(std::string(id))
})
ERROR_RETURN_CODE(GENERIC_ERROR,
int caosdb_transaction_transaction_execute(
caosdb_transaction_transaction *transaction),
Loading