Experiment
DearDiary.get_experiment — Function
get_experiment(id::Integer)::Optional{Experiment}Get a Experiment by id.
Arguments
id::Integer: The id of the experiment to query.
Returns
A Experiment object. If the record does not exist, return nothing.
DearDiary.get_experiments — Function
get_experiments(project_id::Integer)::Array{Experiment, 1}Get all Experiment for a given project.
Arguments
project_id::Integer: The id of the project to query.
Returns
An array of Experiment objects.
DearDiary.create_experiment — Function
create_experiment(project_id::Integer, status_id::Integer, name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::UpsertResult}Create a Experiment.
Arguments
project_id::Integer: The id of the project to create the experiment for.status_id::Integer: The status of the experiment.name::AbstractString: The name of the experiment.
Returns
- The created experiment ID. If an error occurs,
nothingis returned. - An
UpsertResult.Createdif the record was successfully created,Duplicateif the record already exists,Unprocessableif the record violates a constraint, andErrorif an error occurred while creating the record.
create_experiment(project_id::Integer, status::Status, name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::UpsertResult}Create a Experiment.
Arguments
project_id::Integer: The id of the project to create the experiment for.status::Status: The status of the experiment.name::AbstractString: The name of the experiment.
Returns
- The created experiment ID. If an error occurs,
nothingis returned. - An
UpsertResult.Createdif the record was successfully created,Duplicateif the record already exists,Unprocessableif the record violates a constraint, andErrorif an error occurred while creating the record.
DearDiary.update_experiment — Function
update_experiment(id::Integer, status_id::Optional{Integer}, name::Optional{AbstractString}, description::Optional{AbstractString}, end_date::Optional{DateTime})::UpsertResultUpdate a Experiment record.
Arguments
id::Integer: The id of the experiment to update.status_id::Optional{Integer}: The new status of the experiment.name::Optional{AbstractString}: The new name of the experiment.description::Optional{AbstractString}: The new description of the experiment.end_date::Optional{DateTime}: The new end date of the experiment.
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.
update_experiment(id::Integer, status::Status, name::Optional{AbstractString}, description::Optional{AbstractString}, end_date::Optional{DateTime})::UpsertResultUpdate a Experiment record.
Arguments
id::Integer: The id of the experiment to update.status_id::Status: The new status of the experiment.name::Optional{AbstractString}: The new name of the experiment.description::Optional{AbstractString}: The new description of the experiment.end_date::Optional{DateTime}: The new end date of the experiment.
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.
DearDiary.delete_experiment — Function
delete_experiment(id::Integer)::BoolDelete a Experiment record. Also deletes all associated Iteration and Resource records.
Arguments
id::Integer: The id of the experiment to delete.
Returns
true if the record was successfully deleted, false otherwise.