Skip to content
Snippets Groups Projects
Commit f6c01c1f authored by florian's avatar florian
Browse files

DRAFT: Implement insert, update, and delete

parent 3201a617
No related branches found
No related tags found
1 merge request!15ENH: Allow insert/update/delete and files in Extern C
...@@ -461,6 +461,44 @@ ERROR_RETURN_CODE(GENERIC_ERROR, ...@@ -461,6 +461,44 @@ ERROR_RETURN_CODE(GENERIC_ERROR,
return wrapped_transaction->Query(std::string(query)); 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, ERROR_RETURN_CODE(GENERIC_ERROR,
int caosdb_transaction_transaction_execute( int caosdb_transaction_transaction_execute(
caosdb_transaction_transaction *transaction), caosdb_transaction_transaction *transaction),
......
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