Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
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-julialib
Commits
6ca68e17
Commit
6ca68e17
authored
3 years ago
by
Alexander Kreft
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add functions for file upload + code style
parent
010d376a
Branches
Branches containing commit
No related tags found
1 merge request
!8
F full ak
Pipeline
#12626
passed
3 years ago
Stage: info
Stage: code-style
Stage: setup
Stage: test
Stage: deploy
Pipeline: CaosDB Julia Integration Tests
#12628
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CaosDB.jl
+3
-1
3 additions, 1 deletion
src/CaosDB.jl
src/Entity.jl
+36
-1
36 additions, 1 deletion
src/Entity.jl
src/Transaction.jl
+17
-4
17 additions, 4 deletions
src/Transaction.jl
with
56 additions
and
6 deletions
src/CaosDB.jl
+
3
−
1
View file @
6ca68e17
...
...
@@ -75,7 +75,9 @@ export append_parent,
set_datatype
,
set_unit
,
set_value
,
set_importance
set_importance
,
set_local_path
,
set_file_path
# helper functions
export
has_errors
,
has_warnings
...
...
This diff is collapsed.
Click to expand it.
src/Entity.jl
+
36
−
1
View file @
6ca68e17
...
...
@@ -62,7 +62,9 @@ export append_parent,
set_datatype
,
set_unit
,
set_value
,
set_importance
set_importance
,
set_local_path
,
set_file_path
# helper functions
export
has_errors
,
has_warnings
...
...
@@ -1733,6 +1735,39 @@ function set_importance(property::Ref{_Property}, importance::AbstractString)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
end
"""
function set_local_path(entity::Ref{_Entity}, path::AbstractString)
Set the local path of the given `entity` object.
"""
function
set_local_path
(
entity
::
Ref
{
_Entity
},
path
::
AbstractString
)
err_code
=
ccall
(
(
:
caosdb_entity_entity_set_local_path
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Cstring
),
entity
,
path
,
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
end
"""
function set_file_path(entity::Ref{_Entity}, path::AbstractString)
Set the file path of the given `entity` object.
"""
function
set_file_path
(
entity
::
Ref
{
_Entity
},
path
::
AbstractString
)
err_code
=
ccall
(
(
:
caosdb_entity_entity_set_file_path
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Cstring
),
entity
,
path
,
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
end
"""
function append_parent(entity::Ref{_Entity}, parent::Ref{_Parent})
...
...
This diff is collapsed.
Click to expand it.
src/Transaction.jl
+
17
−
4
View file @
6ca68e17
...
...
@@ -150,7 +150,10 @@ Add a sub-request to insert a single entity to the given `transaction`.
This does not execute the transaction.
"""
function
add_insert_entity
(
transaction
::
Ref
{
_Transaction
},
entity
::
Ref
{
CaosDB
.
Entity
.
_Entity
})
function
add_insert_entity
(
transaction
::
Ref
{
_Transaction
},
entity
::
Ref
{
CaosDB
.
Entity
.
_Entity
},
)
err_code
=
ccall
(
(
:
caosdb_transaction_transaction_insert_entity
,
CaosDB
.
library_name
),
...
...
@@ -171,7 +174,10 @@ Add a sub-request to update a single entity to the given `transaction`.
This does not execute the transaction.
"""
function
add_update_entity
(
transaction
::
Ref
{
_Transaction
},
entity
::
Ref
{
CaosDB
.
Entity
.
_Entity
})
function
add_update_entity
(
transaction
::
Ref
{
_Transaction
},
entity
::
Ref
{
CaosDB
.
Entity
.
_Entity
},
)
err_code
=
ccall
(
(
:
caosdb_transaction_transaction_update_entity
,
CaosDB
.
library_name
),
...
...
@@ -245,10 +251,17 @@ Add a sub-request to delete a single entity to the given `transaction`.
This does not execute the transaction.
"""
function
add_retrieve_and_download_file_by_id
(
transaction
::
Ref
{
_Transaction
},
id
::
AbstractString
,
path
::
AbstractString
)
function
add_retrieve_and_download_file_by_id
(
transaction
::
Ref
{
_Transaction
},
id
::
AbstractString
,
path
::
AbstractString
,
)
err_code
=
ccall
(
(
:
caosdb_transaction_transaction_retrieve_and_download_file_by_id
,
CaosDB
.
library_name
),
(
:
caosdb_transaction_transaction_retrieve_and_download_file_by_id
,
CaosDB
.
library_name
,
),
Cint
,
(
Ref
{
_Transaction
},
Cstring
,
Cstring
),
transaction
,
...
...
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