Resource

DearDiary.get_resourceFunction
get_resource(id::Integer)::Optional{Resource}

Get a Resource by id.

Arguments

  • id::Integer: The id of the resource to query.

Returns

A Resource object. If the record does not exist, return nothing.

source
DearDiary.get_resourcesFunction
get_resources(experiment_id::Integer)::Array{Resource, 1}

Get all Resource for a given experiment.

Arguments

  • experiment_id::Integer: The id of the experiment to query.

Returns

An array of Resource objects.

source
DearDiary.create_resourceFunction
create_resource(experiment_id::Integer, name::AbstractString, data::AbstractArray{UInt8,1})::Tuple{Optional{<:Int64},UpsertResult}

Create a new Resource record.

Arguments

  • experiment_id::Integer: The id of the experiment to create the resource for.
  • name::AbstractString: The name of the resource.
  • data::AbstractArray{UInt8,1}: The binary data of the resource.

Returns

An UpsertResult. Created if the record was successfully created, Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.

source
DearDiary.update_resourceFunction
update_resource(id::Integer, name::Optional{AbstractString}, description::Optional{AbstractString}, data::Optional{AbstractArray{UInt8,1}})::UpsertResult

Update a Resource record.

Arguments

  • id::Integer: The id of the resource to update.
  • name::Optional{AbstractString}: The new name for the resource.
  • description::Optional{AbstractString}: The new description for the resource.
  • data::Optional{AbstractArray{UInt8,1}}: The new binary data for the resource.

Returns

An UpsertResult. Updated if the record was successfully updated (or no changes were made), Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.

source
DearDiary.delete_resourceFunction
delete_resource(id::Integer)::Bool

Delete a Resource record.

Arguments

  • id::Integer: The id of the resource to delete.

Returns

true if the record was successfully deleted, false otherwise.

source