CaosDB.jl's API
Below you find the explicit documentation of CaosDB's public interface. You also find the documentation of the internal API which is meant for expert use only. Only use those if you know what you're doing.
CaosDB.Authentication.create_plain_password_authenticatorCaosDB.Connection.connectCaosDB.Connection.connect_manuallyCaosDB.Connection.create_connectionCaosDB.Connection.create_pem_file_certificate_providerCaosDB.Connection.create_tls_connection_configurationCaosDB.Connection.get_version_infoCaosDB.Connection.print_version_infoCaosDB.Entity._get_datatypeCaosDB.Entity._get_valueCaosDB.Entity.append_parentCaosDB.Entity.append_parentsCaosDB.Entity.append_propertiesCaosDB.Entity.append_propertyCaosDB.Entity.create_atomic_datatypeCaosDB.Entity.create_atomic_list_datatypeCaosDB.Entity.create_entityCaosDB.Entity.create_file_entityCaosDB.Entity.create_parentCaosDB.Entity.create_propertyCaosDB.Entity.create_property_entityCaosDB.Entity.create_recordCaosDB.Entity.create_recordtypeCaosDB.Entity.create_reference_datatypeCaosDB.Entity.create_reference_list_datatypeCaosDB.Entity.get_codeCaosDB.Entity.get_datatypeCaosDB.Entity.get_datatypeCaosDB.Entity.get_descriptionCaosDB.Entity.get_descriptionCaosDB.Entity.get_descriptionCaosDB.Entity.get_descriptionCaosDB.Entity.get_errorCaosDB.Entity.get_errorCaosDB.Entity.get_errorsCaosDB.Entity.get_errors_sizeCaosDB.Entity.get_idCaosDB.Entity.get_idCaosDB.Entity.get_idCaosDB.Entity.get_importanceCaosDB.Entity.get_infoCaosDB.Entity.get_infoCaosDB.Entity.get_infosCaosDB.Entity.get_infos_sizeCaosDB.Entity.get_nameCaosDB.Entity.get_nameCaosDB.Entity.get_nameCaosDB.Entity.get_parentCaosDB.Entity.get_parentCaosDB.Entity.get_parentsCaosDB.Entity.get_parents_sizeCaosDB.Entity.get_propertiesCaosDB.Entity.get_properties_sizeCaosDB.Entity.get_propertyCaosDB.Entity.get_propertyCaosDB.Entity.get_roleCaosDB.Entity.get_unitCaosDB.Entity.get_unitCaosDB.Entity.get_valueCaosDB.Entity.get_valueCaosDB.Entity.get_version_idCaosDB.Entity.get_warningCaosDB.Entity.get_warningCaosDB.Entity.get_warningsCaosDB.Entity.get_warnings_sizeCaosDB.Entity.has_errorsCaosDB.Entity.has_warningsCaosDB.Entity.remove_parentCaosDB.Entity.remove_propertyCaosDB.Entity.set_datatypeCaosDB.Entity.set_datatypeCaosDB.Entity.set_datatypeCaosDB.Entity.set_datatypeCaosDB.Entity.set_datatypeCaosDB.Entity.set_datatypeCaosDB.Entity.set_descriptionCaosDB.Entity.set_idCaosDB.Entity.set_idCaosDB.Entity.set_idCaosDB.Entity.set_importanceCaosDB.Entity.set_local_pathCaosDB.Entity.set_nameCaosDB.Entity.set_nameCaosDB.Entity.set_nameCaosDB.Entity.set_remote_pathCaosDB.Entity.set_roleCaosDB.Entity.set_unitCaosDB.Entity.set_unitCaosDB.Entity.set_valueCaosDB.Entity.set_valueCaosDB.Exceptions.evaluate_return_codeCaosDB.Transaction._release_result_atCaosDB.Transaction._release_resultsCaosDB.Transaction._release_resultsCaosDB.Transaction.add_delete_by_idCaosDB.Transaction.add_insert_entityCaosDB.Transaction.add_queryCaosDB.Transaction.add_retrieve_and_download_file_by_idCaosDB.Transaction.add_retrieve_by_idCaosDB.Transaction.add_retrieve_by_idCaosDB.Transaction.add_update_entityCaosDB.Transaction.create_transactionCaosDB.Transaction.create_transactionCaosDB.Transaction.delete_by_idCaosDB.Transaction.executeCaosDB.Transaction.execute_queryCaosDB.Transaction.execute_queryCaosDB.Transaction.get_count_resultCaosDB.Transaction.get_result_atCaosDB.Transaction.get_result_atCaosDB.Transaction.get_result_setCaosDB.Transaction.get_result_sizeCaosDB.Transaction.get_resultsCaosDB.Transaction.get_resultsCaosDB.Transaction.insert_entityCaosDB.Transaction.retrieveCaosDB.Transaction.retrieveCaosDB.Transaction.retrieveCaosDB.Transaction.retrieveCaosDB.Transaction.retrieve_and_download_file_by_idCaosDB.Transaction.update_entityCaosDB.Utility.get_ccaosdb_versionCaosDB.Utility.get_env_fallbackCaosDB.Authentication._AuthenticatorCaosDB.Connection._CertificateProviderCaosDB.Connection._ConfigurationCaosDB.Connection._ConnectionCaosDB.Entity._DataTypeCaosDB.Entity._EntityCaosDB.Entity._MessageCaosDB.Entity._ParentCaosDB.Entity._PropertyCaosDB.Entity._ValueCaosDB.Exceptions.CaosDBExceptionCaosDB.Exceptions.CaosDBMessageCaosDB.Exceptions.ClientExceptionCaosDB.Exceptions.GenericCaosDBExceptionCaosDB.Info._VersionInfoCaosDB.Transaction._ResultSetCaosDB.Transaction._TransactionCaosDB.Constants.MIN_CCAOSDB_VERSIONCaosDB.library_name
Public API
CaosDB.Exceptions.CaosDBException — TypeThe parent type of all CaosDB errors that can also be used for testing.
CaosDB.Exceptions.CaosDBMessage — TypeStruct containing Messages and codes for status codes<0 that do not correspond to errors or success.
CaosDB.Exceptions.ClientException — TypeSomething went wrong on the client-side or the user is attempting to conduct an invalid operation.
CaosDB.Exceptions.GenericCaosDBException — TypeA generic exception that will be raised in case of non-zero return values of the calls to libccaosdb. May carry a message string and a code.
CaosDB.Exceptions.evaluate_return_code — Methodfunction evaluate_return_code(code::Cint)Evaluate the return code of a libccaosdb ccall and raise a GenericCaosDBException in case of a non-zero return code.
CaosDB.Constants.MIN_CCAOSDB_VERSION — ConstantThe minimum version of CaosDB's cpplib and C interface that is supported by this version of CaosDB.jl.
CaosDB.Utility.get_ccaosdb_version — Methodfunction get_ccaosdb_version()Return the version of the CaosDB C interface that is used by CaosDB.jl.
CaosDB.Utility.get_env_fallback — Functionget_env_fallback(var[, default])Return the environmental variable var if it exists, default otherwise. If no default is given an empty string is returned instead.
CaosDB.Connection.connect — Functionconnect(name::AbstractString="default")Create a connection with name name from your configuration file, print the version of the server the connection is established to, and return the connection object.
Arguments
- name::AbstractString="default": The name of the configuration defined in your config json that will be used to connect to the CaosDB server defined therein. Default value is "default".
CaosDB.Connection.connect_manually — Methodfunction connect_manually([;
host::AbstractString="",
port_str::AbstractString="undefined",
cacert::AbstractString="",
username::AbstractString="",
password::AbstractString="undefined"]
)Return a connection object created for the given host:port with an SSL certificate located at cacert with the given credentials.
Extended help
Because of type-stability, and since an empty string may be a valid password, the value of password, for which it is fetched from an environmental variable, is "undefined". This means that if you absolutely must use "undefined" as your password, you have to specify it via the CAOSDB_PASSWORD variable.
Arguments
host::AbstractString="": The hostname of the CaosDB server. If none is provided, theCAOSDB_SERVER_HOSTenvironmental variable is used instead. If that's not defined, "localhost" is used.port_str::AbstractString="undefined": The port of the CaosDB server, given as string. If none is provided, theCAOSDB_SERVER_GRPC_PORT_HTTPSenvironmental variable is used instead. If that's not defined, "8443" is used. The default value is "undefined" rather than an empty string because an empty string could be a valid port, too, i.e. the CaosDB server is available athostwithout a port.cacert::AbstractString="": The path to the SSL certificate of the CaosDB server. If none is provided, theCAOSDB_SERVER_CERTenvironmental variable is used instead.username::AbstractString="": The username with which to log in into the CaosDB server. If none is provided, theCAOSDB_USERenvironmental variable is used instead. If that's not defined, "admin" is used.password::AbstractString="undefined": The password with which to log in into the CaosDB server. If none is provided, theCAOSDB_PASSWORDenvironmental variable is used instead. If that's not defined, "caosdb" is used. The default value is "undefined" rather than an empty string to allow an empty password.
CaosDB.Entity.append_parent — Methodfunction append_parent(entity::Ref{_Entity}, parent::Ref{_Parent})Append the given parent to the parents of the given entity.
CaosDB.Entity.append_parents — Methodfunction append_parents(entity::Ref{_Entity}, parents::Vector{Base.RefValue{_Parent}})Append all given parents to the parents of the given entity.
CaosDB.Entity.append_properties — Methodfunction append_properties(entity::Ref{_Entity}, properties::Vector{Base.RefValue{_Property}})Append all given properties to the properties of the given entity.
CaosDB.Entity.append_property — Methodfunction append_property(entity::Ref{_Entity}, property::Ref{_Property})Append the given property to the properties of the given entity.
CaosDB.Entity.create_entity — Functionfunction create_entity(name::AbstractString = "")Return a new entity object. If a name was provided, set the name of the entity correspondingly.
CaosDB.Entity.create_file_entity — Methodfunction createfileentity(; localpath::AbstractString, remotepath::AbstractString, name::AbstractString = "", )
Return a new entity object with role File. local_path is the path of the file on the local file system. An exception is thrown if this file is not existent. remote_path is the path of the file on the remote caosdb server.
CaosDB.Entity.create_parent — Methodfunction create_parent(; name::AbstractString = "", id::AbstractString = "")Create a parent object that can be appended to another _Entity. If name, id, or value are given, the parent's name, id, or value are set accordingly.
This is not an _Entity that could be inserted or updated by its own but a _Parent that is to be appended to another _Entity.
CaosDB.Entity.create_property — Methodfunction create_property(;
name::AbstractString = "",
id::AbstractString = "",
value::Union{AbstractString, Number, Bool} = "",
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing} = nothing,
)Create a property object that can be appended to another _Entity. If name, id, or value are given, the property's name, id, or value are set accordingly. The datatype and its collection type can be specified with datatype and collection, respectively.
This is not an _Entity that could be inserted or updated by its own but a _Property that is to be appended to another _Entity.
CaosDB.Entity.create_property_entity — Methodfunction create_property_entity(;
name::AbstractString = "",
datatype::Union{AbstractString,CaosDB.Constants.DATATYPE._DATATYPE} = "",
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION,Nothing} = nothing,
unit::AbstractString = "",
)Return a new entity object with role Record. If name, datatype, or unit were provided, its name, datatype (including whether its collection type), or unit are set accordingly.
CaosDB.Entity.create_record — Function function create_record(name::AbstractString = "")Return a new entity object with role Record. If a name was provided, its name is set accordingly.
CaosDB.Entity.create_recordtype — Functionfunction create_recordtype(name::AbstractString = "")Return a new entity object with role RecordType. If a name was provided, its name is set accordingly.
CaosDB.Entity.get_code — Methodfunction get_code(message::Ref{_Message})Return the code of the given message.
CaosDB.Entity.get_datatype — Methodfunction get_datatype(entity::Ref{_Entity})Return a tuple that contains the name of the datatype of the given entity, and its collection type (nothing in case of a scalar datatype).
CaosDB.Entity.get_datatype — Methodfunction get_datatype(entity::Ref{_Property})Return a tuple that contains the name of the datatype of the given property, whether it is a reference, and whether it is a list.
CaosDB.Entity.get_description — Methodfunction get_description(entity::Ref{_Entity})Return the description of the given entity
CaosDB.Entity.get_description — Methodfunction get_description(entity::Ref{_Message})Return the description of the given message
CaosDB.Entity.get_description — Methodfunction get_description(entity::Ref{_Parent})Return the description of the given parent
CaosDB.Entity.get_description — Methodfunction get_description(entity::Ref{_Property})Return the description of the given property
CaosDB.Entity.get_error — Methodfunction get_error(entity::Ref{_Entity}, index::Cint)Return the error message of the given entity with the provided index.
CaosDB.Entity.get_error — Methodfunction get_error(entity::Ref{_Entity}, index::Integer)Convenience wrapper for get_error(::Ref{_Entity}, ::Cint). Convert index to Int32 and return the error at position index of the given entity.
CaosDB.Entity.get_errors — Methodfunction get_errors(entity::Ref{_Entity})Return a Vector of all error messages attached to the given entity.
CaosDB.Entity.get_id — Methodfunction get_id(entity::Ref{_Entity})Return the id of the given entity
CaosDB.Entity.get_id — Methodfunction get_id(entity::Ref{_Parent})Return the id of the given parent
CaosDB.Entity.get_id — Methodfunction get_id(entity::Ref{_Property})Return the id of the given property
CaosDB.Entity.get_importance — Methodfunction get_importance(property::Ref{_Property})Return the importance of the given property
CaosDB.Entity.get_info — Methodfunction get_info(entity::Ref{_Entity}, index::Cint)Return the info message of the given entity with the provided index.
CaosDB.Entity.get_info — Methodfunction get_info(entity::Ref{_Entity}, index::Integer)Convenience wrapper for get_info(::Ref{_Entity}, ::Cint). Convert index to Int32 and return the info at position index of the given entity.
CaosDB.Entity.get_infos — Methodfunction get_warnings(entity::Ref{_Entity})Return a Vector of all info messages attached to the given entity.
CaosDB.Entity.get_name — Methodfunction get_name(entity::Ref{_Entity})Return the name of the given entity
CaosDB.Entity.get_name — Methodfunction get_name(entity::Ref{_Parent})Return the name of the given parent
CaosDB.Entity.get_name — Methodfunction get_name(entity::Ref{_Property})Return the name of the given property
CaosDB.Entity.get_parent — Methodfunction get_parent(entity::Ref{_Entity}, index::Cint)Return the parent of the given entity at position index.
CaosDB.Entity.get_parent — Methodfunction get_parent(entity::Ref{_Entity}, index::Integer)Convenience wrapper for get_parent(::Ref{_Entity}, ::Cint). Convert index to Int32 and return the parent at position index of the given entity.
CaosDB.Entity.get_parents — Methodfunction get_parents(entity::Ref{_Entity})Return the vector of all parents of the given entity.
CaosDB.Entity.get_properties — Methodfunction get_properties(entity::Ref{_Entity})Return the vector of all properties of the given entity.
CaosDB.Entity.get_property — Methodfunction get_property(entity::Ref{_Entity}, index::Cint)Return the property of the given entity at position index.
CaosDB.Entity.get_property — Methodfunction get_property(entity::Ref{_Entity}, index::Integer)Convenience wrapper for get_property(::Ref{_Entity}, ::Cint). Convert index to Int32 and return the property at position index of the given entity.
CaosDB.Entity.get_role — Methodfunction get_role(entity::Ref{_Entity})Return the role of the given entity.
CaosDB.Entity.get_unit — Methodfunction get_unit(entity::Ref{_Entity})Return the unit of the given entity
CaosDB.Entity.get_unit — Methodfunction get_unit(entity::Ref{_Property})Return the unit of the given property
CaosDB.Entity.get_value — Methodfunction get_value(entity::Ref{_Entity})Return the value of the given entity
CaosDB.Entity.get_value — Methodfunction get_value(property::Ref{_Property})Return the value of the given property
CaosDB.Entity.get_version_id — Methodfunction get_version_id(entity::Ref{_Entity})Return the version_id of the given entity
CaosDB.Entity.get_warning — Methodfunction get_warning(entity::Ref{_Entity}, index::Cint)Return the warning message of the given entity with the provided index.
CaosDB.Entity.get_warning — Methodfunction get_warning(entity::Ref{_Entity}, index::Integer)Convenience wrapper for get_warning(::Ref{_Entity}, ::Cint). Convert index to Int32 and return the warning at position index of the given entity.
CaosDB.Entity.get_warnings — Methodfunction get_warnings(entity::Ref{_Entity})Return a Vector of all warning messages attached to the given entity.
CaosDB.Entity.has_errors — Methodfunction has_errors(entity::Ref{_Entity})Return true if the given entity has errors, false otherwise.
CaosDB.Entity.has_warnings — Methodfunction has_warnings(entity::Ref{_Entity})Return true if the given entity has warnings, false otherwise.
CaosDB.Entity.remove_parent — Methodfunction remove_parent(entity::Ref{_Entity}, index::Cint)Remove the parent at position index from the parents of the given entity.
CaosDB.Entity.remove_property — Methodfunction remove_property(entity::Ref{_Entity}, index::Cint)Remove the property at position index from the properties of the given entity.
CaosDB.Entity.set_datatype — Functionfunction set_datatype(
entity::Ref{_Entity},
datatype::AbstractString,
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing}
)Set the datatype of the given entity object to a reference to the given datatype name. Only possible if the role of the entity is "PROPERTY". Specify whether the datatype is a list by specifying a collection. If none is given, a scalar datatype is set.
CaosDB.Entity.set_datatype — Functionfunction set_datatype(
property::Ref{_Property},
datatype::CaosDB.Constants.DATATYPE._DATATYPE,
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing}
)Set the datatype of the given property object to a reference to the given atomic datatype. Specify whether the datatype is a list by specifying a collection. If none is given, a scalar datatype is set.
CaosDB.Entity.set_datatype — Functionfunction set_datatype(
property::Ref{_Property},
datatype::AbstractString,
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing}
)Set the datatype of the given property object to a reference to the given datatype name. Specify whether the datatype is a list by specifying a collection. If none is given, a scalar datatype is set.
CaosDB.Entity.set_datatype — Functionfunction set_datatype(
entity::Ref{_Entity},
datatype::CaosDB.Constants.DATATYPE._DATATYPE,
collection::Union{CaosDB.Constants.COLLECTION._COLLECTION, Nothing}
)Set the datatype of the given entity object to a reference to the given atomic datatype. Only possible if the role of the entity is "PROPERTY". Specify whether the datatype is a list by specifying a collection. If none is given, a scalar datatype is set.
CaosDB.Entity.set_datatype — Methodfunction set_datatype(entity::Ref{_Entity}, datatype::Tuple{Any, Any})Convenience wrapper for the set_datatype functions s.th. expressions like set_datatype(entity_a, get_datatype(entity_b)) work.
CaosDB.Entity.set_datatype — Methodfunction set_datatype(property::Ref{_Property}, datatype::Tuple{Any, Any})Convenience wrapper for the set_datatype functions s.th. expressions like set_datatype(property_a, get_datatype(property_b)) work.
CaosDB.Entity.set_description — Methodfunction set_description(entity::Ref{_Entity}, description::AbstractString)Set the description of the given entity object.
CaosDB.Entity.set_id — Methodfunction set_id(entity::Ref{_Entity}, id::AbstractString)Throws a CaosDB.Exceptions.ClientException since you are not allowed to set the id of entities.
CaosDB.Entity.set_id — Methodfunction set_id(parent::Ref{_Parent}, id::AbstractString)Set the id of the given parent object.
CaosDB.Entity.set_id — Methodfunction set_id(property::Ref{_Property}, id::AbstractString)Set the id of the given property object.
CaosDB.Entity.set_importance — Methodfunction set_importance(
property::Ref{_Property},
importance::CaosDB.Constants.IMPORTANCE._IMPORTANCE
)Set the importance of the given property object.
CaosDB.Entity.set_local_path — Methodfunction set_local_path(entity::Ref{_Entity}, path::AbstractString)Set the local path of the given entity object.
CaosDB.Entity.set_name — Methodfunction set_name(entity::Ref{_Entity}, name::AbstractString)Set the name of the given entity object.
CaosDB.Entity.set_name — Methodfunction set_name(parent::Ref{_Parent}, name::AbstractString)Set the name of the given parent object.
CaosDB.Entity.set_name — Methodfunction set_name(property::Ref{_Property}, name::AbstractString)Set the name of the given property object.
CaosDB.Entity.set_remote_path — Methodfunction set_remote_path(entity::Ref{_Entity}, path::AbstractString)Set the remote file path of the given entity object.
CaosDB.Entity.set_role — Methodfunction set_role(entity::Ref{_Entity}, role::CaosDB.Constants.ROLE._ROLE)Set the role of the given entity object.
CaosDB.Entity.set_unit — Methodfunction set_unit(entity::Ref{_Entity}, unit::AbstractString)Set the unit of the given entity object.
CaosDB.Entity.set_unit — Methodfunction set_unit(property::Ref{_Property}, unit::AbstractString)Set the unit of the given property object.
CaosDB.Entity.set_value — Methodfunction set_value(
entity::Ref{_Entity},
value::Union{AbstractString,Number,Bool,Vector{T}},
) where {T<:Union{AbstractString,Number,Bool}}Set the value of the given entity object. Throw an error if it doesn't have the correct role. The value must be either string, Boolean, Integer, Float, or a vector thereof.
CaosDB.Entity.set_value — Methodfunction set_value(property::Ref{_Property}, value::AbstractString)Set the value of the given property object.
CaosDB.Transaction.add_delete_by_id — Methodfunction add_delete_by_id(transaction::Ref{_Transaction}, id::AbstractString)Add a sub-request to delete a single entity to the given transaction.
This does not execute the transaction.
CaosDB.Transaction.add_insert_entity — Methodfunction add_insert_entity(transaction::Ref{_Transaction}, entity::Ref{_CaosDB.Entity.Entity})Add a sub-request to insert a single entity to the given transaction.
This does not execute the transaction.
CaosDB.Transaction.add_query — Methodfunction add_query(transaction::Ref{_Transaction}, query::AbstractString)Add a query sub-request to the given transaction.
Only COUNT queris and FIND queries (and no SELECT queries) are currently supported.
This does not execute the transaction
CaosDB.Transaction.add_retrieve_and_download_file_by_id — Methodfunction add_retrieve_and_download_file_by_id(
transaction::Ref{_Transaction},
id::AbstractString,
path::AbstractString,
)Add a sub-request to retrieve and download a single entity (File) to the given transaction.
This does not execute the transaction.
CaosDB.Transaction.add_retrieve_by_id — Methodfunction add_retrieve_by_id(transaction::Ref{_Transaction}, id::AbstractString)Add a sub-request to retrieve a single entity by its id to the given transaction.
This does not execute the transaction.
CaosDB.Transaction.add_retrieve_by_id — Methodfunction add_retrieve_by_id(
transaction::Ref{_Transaction},
ids::Vector{T},
) where {T<:AbstractString}Add a sub-request to retrieve several entities by their ids to the given transaction.
This does not execute the transaction.
CaosDB.Transaction.add_update_entity — Methodfunction add_update_entity(transaction::Ref{_Transaction}, entity::Ref{_CaosDB.Entity.Entity})Add a sub-request to update a single entity to the given transaction.
This does not execute the transaction.
CaosDB.Transaction.create_transaction — Functioncreate_transaction(name::AbstractString = "default")Return a transaction created with the connection of the given name. If none is given, the defult connection is used.
CaosDB.Transaction.create_transaction — Methodfunction create_transaction(connection::Ref{CaosDB.Connection._Connection})Return a transactioncreated with the given connection object.
CaosDB.Transaction.delete_by_id — Methodfunction delete_by_id(id::AbstractString)Delete a single Entity identified by its id.
CaosDB.Transaction.execute — Methodfunction execute(transaction::Ref{_Transaction})Send the given transaction to the CaosDB server for excecution and wait for it to finish.
CaosDB.Transaction.execute_query — Functionfunction execute_query(
query::AbstractString,
name::AbstractString = "default"
)Execute the given query and return its results. Use the connection with the given name. If none is given, the default connection is used.
Since only the resulting entities are returned, this only makes sense for FIND (and, in the future, SELECT) queries. To get the result of a COUNT query, you have to execute the transaction yourself using create_transaction, add_query, and execute, and get the result with get_count_result.
CaosDB.Transaction.execute_query — Methodfunction execute_query(
query::AbstractString,
connection::Ref{CaosDB.Connection._Connection}
)Execute the given query and return its results. Use the given connection.
Since only the resulting entities are returned, this only makes sense for FIND (and, in the future, SELECT) queries. To get the result of a COUNT query, you have to execute the transaction yourself using create_transaction, add_query, and execute, and get the result with get_count_result.
CaosDB.Transaction.get_count_result — Methodfunction get_count_result(transaction::Ref{_Transaction})Return the number of results of the COUNT query in the given transaction.
This is only a meaningful quantity if there actually was a COUNT query in the transaction, and it already has been executed. In all other cases the return value will be -1.
CaosDB.Transaction.get_result_at — Methodfunction get_result_at(results::Ref{_ResultSet}, index::Cint)Return the entity at position index of the given results.
CaosDB.Transaction.get_result_at — Methodfunction get_result_at(results::Ref{_ResultSet}, index::Integer)Convenience wrapper for get_result_at(::Ref{_ResultSet}, ::Cint). Convert the given index to Int32 and return the result at position index of results.
CaosDB.Transaction.get_result_set — Methodfunction get_result_set(transaction::Ref{_Transaction})Return the result set of the given transaction.
CaosDB.Transaction.get_results — Methodfunction get_results(result_set::Ref{_ResultSet})Return all entities of the given result_set.
CaosDB.Transaction.get_results — Methodfunction get_results(transaction::Ref{_Transaction})Return all results of the given transaction.
CaosDB.Transaction.insert_entity — Methodfunction insert_entity(entity::Ref{CaosDB.Entity._Entity})Insert a single Entity.
CaosDB.Transaction.retrieve — Functionfunction retrieve(id::AbstractString, name::AbstractString = "default")Retrieve and return the entity with the given id. Use the connection with the given name. If none is provided, the default connection is used.
CaosDB.Transaction.retrieve — Methodfunction retrieve(id::AbstractString, connection::Ref{CaosDB.Connection._Connection})Retrieve and return the entity with the given id. Use the given connection.
CaosDB.Transaction.retrieve — Methodfunction retrieve(
ids::Vector{T},
connection::Ref{CaosDB.Connection._Connection},
) where {T<:AbstractString}Retrieve and return the entities with the given ids. Use the given connection.
CaosDB.Transaction.retrieve — Methodfunction retrieve(
ids::Vector{T},
name::AbstractString = "default",
) where {T<:AbstractString}Retrieve and return the entities with the given ids. Use the connection of the given name. If none is provided, the default connection is used.
CaosDB.Transaction.retrieve_and_download_file_by_id — Methodfunction retrieve_and_download_file_by_id(
id::AbstractString,
download_path::AbstractString)Retrieve and download a single File-Entity identified by its id. download_path is the path where the file will be downloaded.
CaosDB.Transaction.update_entity — Methodfunction update_entity(entity::Ref{CaosDB.Entity._Entity})Update a single Entity.
Expert-use only API functions
CaosDB.library_name — ConstantChose the name of the library according to the OS you're running.
CaosDB.Info._VersionInfo — TypeStruct containing version information of the CaosDB server. Meant mainly for internal usage; use CaosDB.Connection.get_version_info or CaosDB.Connection.print_version_info to retrieve the version of the connected CaosDB server.
CaosDB.Connection._CertificateProvider — TypeStruct containing a pointer to the wrapped cpp class providing the certificate provider. Meant for internal use; call a CaosDB.Connection.create_<certificate_provider> function to create an certificate-provider object from a configuration.
CaosDB.Connection._Configuration — TypeStruct containing a pointer to the wrapped cpp class for storing the connection configuration. Meant for internal use; call a CaosDB.Connection.create_<configuration> function to create an connection-configuration object from a configuration.
CaosDB.Connection._Connection — TypeStruct containing the actual connection to a CaosDB server. Meant for internal use; call a CaosDB.Connection.create_<connection> function to create an connection object from a configuration.
CaosDB.Connection.create_connection — Methodcreate_connection(config::Ref{_Configuration})Return a connection based on the given config.
CaosDB.Connection.create_pem_file_certificate_provider — Methodcreate_pem_file_certificate_provider(path::AbstractString)Return a _CertificateProvider for the pem certificate located at path.
CaosDB.Connection.create_tls_connection_configuration — Methodcreate_tls_connection_configuration(
host::AbstractString,
port::Cint,
authenticator::Ref{CaosDB.Authentication._Authenticator},
provider::Ref{_CertificateProvider}
)Return a TLS connection configuration with authentication.
CaosDB.Connection.get_version_info — Methodget_version_info(con::Ref{_Connection})Return the version of the CaosDB server that con is connected to.
CaosDB.Connection.print_version_info — Methodprint_version_info(con::Ref{_Connection})Retrieve the version info for the CaosDB server con is connected to, and print the version in a nice message.
CaosDB.Authentication._Authenticator — TypeStruct containing a pointer to the wrapped cpp authenticator class. Meant for internal use; call a CaosDB.Authentication.create_<authenticator> function to create an authenticator object from a configuration.
CaosDB.Authentication.create_plain_password_authenticator — Methodcreate_plain_password_authenticator(
username::AbstractString,
password::AbstractString,
)Return an authenticator object that contains a wrapped cpp plain-password authenticator configured with username and password.
CaosDB.Entity._DataType — TypeStruct containing a pointer to the wrapped cpp DataType object. Meant for internal use only; use CaosDB.Entity.create_<type>_datatype to create a valid DataType object or use the `set/getdatatype` functions.
CaosDB.Entity._Entity — TypeStruct containing a pointer to the wrapped cpp entity object. Meant for internal use; use CaosDB.Entity.create_entity to create an entity.
CaosDB.Entity._Message — TypeStruct containing a pointer to the wrapped cpp messsage object. Meant for internal use only; don't create it by yourself.
CaosDB.Entity._Parent — TypeStruct containing a pointer to the wrapped cpp parent object. Meant for internal use; use CaosDB.Entity.create_parent to create an parent.
CaosDB.Entity._Property — TypeStruct containing a pointer to the wrapped cpp property object. Meant for internal use; use CaosDB.Entity.create_property to create an property.
CaosDB.Entity._Value — TypeStruct containing a pointer to the wrapped cpp AbstractValue object. Meant for internal use only; use CaosDB.Entity.create_value to create a Value object or use the `set/getvaluefunctions.
CaosDB.Entity._get_datatype — Methodfunction _get_datatype(datatype::Ref{_DataType})Return a tuple that contains the name of the datatype, and its collection type (nothing in case of a scalar datatype).
CaosDB.Entity._get_value — Methodfunction _get_value(value::Ref{_Value})Return the value of the given CaosDB value object.
CaosDB.Entity.create_atomic_datatype — Methodfunction create_atomic_datatype(name::CaosDB.Constants.DATATYPE._DATATYPE)Create and return a DataType object with an atomic datatype specified by the name.
CaosDB.Entity.create_atomic_list_datatype — Methodfunction create_atomic_list_datatype(name::CaosDB.Constants.DATATYPE._DATATYPE)Create and return a DataType object which is a list of atomics specified by name.
CaosDB.Entity.create_reference_datatype — Methodfunction create_reference_datatype(name::AbstractString)Create and return a DataType object with a reference datatype specified by name.
CaosDB.Entity.create_reference_list_datatype — Methodfunction create_reference_list_datatype(name::AbstractString)Create and return a DataType object which is a list of references specified by name.
CaosDB.Entity.get_errors_size — Methodfunction get_errors_size(entity::Ref{_Entity})Return the number of error messages attached to the given entity.
CaosDB.Entity.get_infos_size — Methodfunction get_infos_size(entity::Ref{_Entity})Return the number of info messages attached to the given entity.
CaosDB.Entity.get_parents_size — Methodfunction get_parents_size(entity::Ref{_Entity})Return the number of parents attached to the given entity.
CaosDB.Entity.get_properties_size — Methodfunction get_properties_size(entity::Ref{_Entity})Return the number of properties attached to the given entity.
CaosDB.Entity.get_warnings_size — Methodfunction get_warnings_size(entity::Ref{_Entity})Return the number of warning messages attached to the given entity.
CaosDB.Transaction._ResultSet — TypeStruct containing a pointer to the wrapped cpp result set of a transaction. The struct is meant for internal use only and shouldn't be created directly by the user but is returned by, e.g., get_result_set.
CaosDB.Transaction._Transaction — TypeStruct containing a pointer to the wrapped cpp transaction object. Meant for internal use; call CaosDB.Transaction.create_transaction to create a transaction object.
CaosDB.Transaction._release_result_at — Methodfunction _release_result_at(results::Ref{_ResultSet}, index::Cint)Return the entity at position index of the given results.
This function releases the entity from the result set and leaves the result set in a corrupted state. It should only be used to release the entity from a result set which is about to be destroyed anyway.
CaosDB.Transaction._release_results — Methodfunction _release_results(result_set::Ref{_ResultSet})Return all entities of the given result_set.
This function also leaves the resultset object in a corrupted state and should only be used to release the entities from a resultset which is about to be destroyed anyway.
CaosDB.Transaction._release_results — Methodfunction _release_results(transaction::Ref{_Transaction})Return all results fo the given transaction.
This function also leaves the transaction object in a corrupted state and should only be used to release the results from a transaction which is about to be destroyed anyway.
CaosDB.Transaction.get_result_size — Methodfunction get_result_size(results::Ref{_ResultSet})Return the size of the given results, i.e., the number of entities or other responses returned in this result set.