Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
897da977
Commit
897da977
authored
3 years ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: rename Transaction::RetrieveAndDownloadFilesById
parent
0115f88b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!15
ENH: Allow insert/update/delete and files in Extern C
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/Examples.rst
+2
-2
2 additions, 2 deletions
doc/Examples.rst
include/caosdb/transaction.h
+1
-1
1 addition, 1 deletion
include/caosdb/transaction.h
src/caosdb/transaction.cpp
+2
-2
2 additions, 2 deletions
src/caosdb/transaction.cpp
test/test_transaction.cpp
+1
-1
1 addition, 1 deletion
test/test_transaction.cpp
with
6 additions
and
6 deletions
doc/Examples.rst
+
2
−
2
View file @
897da977
...
...
@@ -224,11 +224,11 @@ Up- and Download a file
const auto &insert_results = insert_transaction->GetResultSet();
const auto &inserted_file = insert_results.at(0);
// for the download you need to use the RetrieveAndDownloadFile
s
ById task and
// for the download you need to use the RetrieveAndDownloadFileById task and
// supply the path where the file shall be stored
test_download_file = fs::path("test_download_file_delete_me.dat");
auto download_transaction(connection->CreateTransaction());
download_transaction->RetrieveAndDownloadFile
s
ById(
download_transaction->RetrieveAndDownloadFileById(
inserted_file.GetId(), test_download_file.string());
download_transaction->ExecuteAsynchronously();
download_transaction->WaitForIt().GetCode()
...
...
This diff is collapsed.
Click to expand it.
include/caosdb/transaction.h
+
1
−
1
View file @
897da977
...
...
@@ -279,7 +279,7 @@ public:
* If the file cannot be downloaded due to unsufficient permissions an error
* is appended.
*/
auto
RetrieveAndDownloadFile
s
ById
(
const
std
::
string
&
id
,
const
std
::
string
&
local_path
)
noexcept
auto
RetrieveAndDownloadFileById
(
const
std
::
string
&
id
,
const
std
::
string
&
local_path
)
noexcept
->
StatusCode
;
/**
...
...
This diff is collapsed.
Click to expand it.
src/caosdb/transaction.cpp
+
2
−
2
View file @
897da977
...
...
@@ -172,8 +172,8 @@ auto Transaction::RetrieveById(const std::string &id) noexcept -> StatusCode {
return
this
->
status
.
GetCode
();
}
auto
Transaction
::
RetrieveAndDownloadFile
s
ById
(
const
std
::
string
&
id
,
const
std
::
string
&
local_path
)
noexcept
auto
Transaction
::
RetrieveAndDownloadFileById
(
const
std
::
string
&
id
,
const
std
::
string
&
local_path
)
noexcept
->
StatusCode
{
ASSERT_CAN_ADD_RETRIEVAL
...
...
This diff is collapsed.
Click to expand it.
test/test_transaction.cpp
+
1
−
1
View file @
897da977
...
...
@@ -199,7 +199,7 @@ TEST(test_transaction, test_retrieve_and_download) {
auto
transaction
=
connection
.
CreateTransaction
();
EXPECT_EQ
(
transaction
->
GetStatus
().
GetCode
(),
StatusCode
::
INITIAL
);
transaction
->
RetrieveAndDownloadFile
s
ById
(
"asdf"
,
"local_path"
);
transaction
->
RetrieveAndDownloadFileById
(
"asdf"
,
"local_path"
);
EXPECT_EQ
(
transaction
->
GetStatus
().
GetCode
(),
StatusCode
::
GO_ON
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment