ENH: Implement queries and entity retrieval
Summary
See https://gitlab.indiscale.com/caosdb/customers/lfpb/management/-/issues/386.
Focus
Point the reviewer to the core of the code change. Where should they start
reading? What should they focus on (e.g. security, performance,
maintainability, user-friendliness, compliance with the specs, finding more
corner cases, concrete questions)?
Test Environment
How to set up a test environment for manual testing?
Check List for the Author
Please, prepare your MR for a review. Be sure to write a summary and a focus and create gitlab comments for the reviewer. They should guide the reviewer through the changes, explain your changes and also point out open questions. For further good practices have a look at our review guidelines
-
All automated tests pass -
Reference related Issues -
Up-to-date CHANGELOG.md -
Annotations in code (Gitlab comments) - Intent of new code
- Problems with old code
- Why this implementation?
Check List for the Reviewer
-
I understand the intent of this MR -
All automated tests pass -
Up-to-date CHANGELOG.md -
The test environment setup works and the intended behavior is reproducible in the test environment -
In-code documentation and comments are up-to-date. -
Check: Are there spezifications? Are they satisfied?
For further good practices have a look at our review guidelines.
Edited by Henrik tom Wörden
Merge request reports
Activity
mentioned in merge request caosdb-juliainttest!3 (merged)
added 8 commits
- d7537e93 - MAINT: Add caosdb_client.json for tests
- c01a8864 - DOC: Add hint to config file
- 1cf223b6 - DRAFT: Move Transaction module to separate file
- 82d75b25 - DRAFT: Begin tests for transactions
- 3daa6ee5 - ENH: Implement create_transaction
- e40a8c77 - MAINT: Add caosdb config file
- 381fff84 - ENH: Implement retrievals and update docstrings
- a1ce9bdd - STY: whitespaces
Toggle commit list5 5 is meant for expert use only. Only use those if you know what you're 6 6 doing. 7 7 8 ```@index 9 Order = [:module, :function, :macro, :type, :constant] - src/Transaction.jl 0 → 100644
118 Add a sub-request to retrieve several entities by their `ids` to the 119 given `transaction`. 120 121 !!! info 122 123 This does not execute the transaction. 124 """ 125 function add_retrieve_by_id( 126 transaction::Ref{_Transaction}, 127 ids::Vector{T}, 128 ) where {T<:AbstractString} 129 130 err_code = ccall( 131 (:caosdb_transaction_transaction_retrieve_by_ids, CaosDB.library_name), 132 Cint, 133 (Ref{_Transaction}, Ptr{Ptr{Cchar}}), changed this line in version 4 of the diff
added 6 commits
- 45dabd84 - DRAFT: Begin implementation of entities
- 5ef97a84 - ENH: Add Exception type for client exceptions
- 475a378f - FIX: Correct arguments for retrieve_by_ids
- 2b379aff - DRAFT: Begin implementation of entities
- f5bd5529 - ENH: Add test for entities
- 0be053a7 - DRAFT: Add a lot of setters, getters, and helper functions
Toggle commit listadded 1 commit
- b3e4ab79 - MAINT: Move remaining modules to separate files
- src/Authentication.jl 0 → 100644
57 end 58 59 Base.showerror(io::IO, e::CaosDBException) = 60 print(io, "CaosDBException: ", e.msg, " (Status code ", e.code, ")") 61 62 """ 63 Struct containing Messages and codes for status codes<0 that do not 64 correspond to errors or success. 65 """ 66 struct CaosDBMessage 67 msg::String 68 code::Cint 69 end 70 71 Base.show(io::IO, m::CaosDBMessage) = print(io, m.msg, " (Status code ", m.code, ")") 102 # include modules from other files 34 34 """ 35 35 mutable struct _Connection 36 36 wrapped_connection::Ptr{Cvoid} 37 _deletable::Bool 34 34 """ 35 35 mutable struct _Connection 36 36 wrapped_connection::Ptr{Cvoid} 37 _deletable::Bool 37 38 38 39 function _Connection(managed_by_julia::Bool = false) 39 40 conn = new() 41 conn._deletable = false - src/Exceptions.jl 0 → 100644
- src/Exceptions.jl 0 → 100644
36 37 """ 38 A generic exception that will be raised in case of non-zero return 39 values of the calls to libccaosdb. May carry a message string and a 40 code. 41 """ 42 struct GenericCaosDBException <: CaosDBException 43 msg::String 44 code::Cint 45 end 46 47 """ 48 Something went wrong on the client-side or the user is attempting to 49 conduct an invalid operation. 50 """ 51 struct ClientException <: CaosDBException - src/Exceptions.jl 0 → 100644
42 struct GenericCaosDBException <: CaosDBException 43 msg::String 44 code::Cint 45 end 46 47 """ 48 Something went wrong on the client-side or the user is attempting to 49 conduct an invalid operation. 50 """ 51 struct ClientException <: CaosDBException 52 msg::String 53 code::Cint 54 55 function ClientException(message::AbstractString) 56 client_error_code = 57 ccall((:caosdb_status_code_OTHER_CLIENT_ERROR, CaosDB.library_name), Cint, ()) - src/Info.jl 0 → 100644
- src/Transaction.jl 0 → 100644
61 end 62 return trans 63 end 64 end 65 66 """ 67 Struct containing a pointer to the wrapped cpp result set of a 68 transaction. The struct is meant for internal use only and shouldn't 69 be created directly by the user but is returned by, e.g., 70 `get_result_set`. 71 """ 72 mutable struct _ResultSet 73 wrapped_result_set::Ptr{Cvoid} 74 _deletable::Bool 75 76 function _ResultSet()
Please register or sign in to reply