Project
DearDiary.get_project — Functionget_project(id::Integer)::Optional{Project}Get a Project by id.
Arguments
id::Integer: The id of the project to query.
Returns
A Project object. If the record does not exist, return nothing.
DearDiary.get_projects — FunctionDearDiary.create_project — Functioncreate_project(user_id::Integer, name::AbstractString)::Tuple{Optional{<:Int64},UpsertResult}Create a Project.
Arguments
user_id::Integer: The id of the user creating the project. The user must have admin privileges.name::AbstractString: The name of the project.
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.
create_project(name::AbstractString)::Tuple{Optional{<:Int64},UpsertResult}Create a Project. Uses the "default" user to create the project.
Arguments
name::AbstractString: The name of the project.
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.
DearDiary.update_project — Functionupdate_project(id::Int, name::Optional{AbstractString}, description::Optional{AbstractString})::UpsertResultUpdate a Project record.
Arguments
id::Integer: The id of the project to update.name::Optional{AbstractString}: The new name for the project.description::Optional{AbstractString}: The new description for the project.
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_project — Functiondelete_project(id::Integer)::BoolDelete a Project record. Also deletes all associated UserPermission and Experiment records.
Arguments
id::Integer: The id of the project to delete.
Returns
true if the record was successfully deleted, false otherwise.