Project

DearDiary.get_projectFunction
get_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.

source
DearDiary.create_projectFunction
create_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.

source
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.

source
DearDiary.update_projectFunction
update_project(id::Int, name::Optional{AbstractString}, description::Optional{AbstractString})::UpsertResult

Update 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.

source