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
3daa6ee5
Commit
3daa6ee5
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Implement create_transaction
parent
82d75b25
No related branches found
Branches containing commit
No related tags found
1 merge request
!7
ENH: Implement queries and entity retrieval
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Transaction.jl
+36
-0
36 additions, 0 deletions
src/Transaction.jl
with
36 additions
and
0 deletions
src/Transaction.jl
+
36
−
0
View file @
3daa6ee5
...
...
@@ -23,6 +23,8 @@
module
Transaction
export
create_transaction
using
CaosDB
"""
...
...
@@ -50,4 +52,38 @@ mutable struct _Transaction
end
end
"""
create_transaction(name::AbstractString = "
default
")
Return a transaction created with the connection of the given name. If
none is given, the defult connection is used.
"""
function
create_transaction
(
name
::
AbstractString
=
"default"
)
connection
=
CaosDB
.
Connection
.
get_connection
(
name
)
return
create_transaction
(
connection
)
end
"""
function create_transaction(connection::Ref{CaosDB.Connection._Connection})
Return a transactioncreated with the given connection object.
"""
function
create_transaction
(
connection
::
Ref
{
CaosDB
.
Connection
.
_Connection
})
transaction
=
Ref
{
_Transaction
}(
_Transaction
(
true
))
err_code
=
ccall
(
(
:
caosdb_connection_connection_create_transaction
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
CaosDB
.
Connection
.
_Connection
},
Ref
{
_Transaction
}),
connection
,
transaction
,
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
return
transaction
end
end
# 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