Miscellaneous

Database

DearDiary.initialize_databaseFunction
initialize_database(; file_name::String="deardiary.db")

Open file_name (creating it if needed), run every pending Migration via apply_migrations, and re-seed the default user. Safe to call repeatedly: each migration runs at most once per database, and the default-user INSERT OR IGNORE is a no-op when the row already exists.

source
DearDiary.get_databaseFunction
get_database()::Union{SQLite.DB,Nothing}

Returns a SQLite database connection. If the database has not been initialized, it returns nothing.

Returns

A SQLite.DB object, or nothing if the database is not initialized.

source

Enumerations

DearDiary.IN_PROGRESSConstant
IN_PROGRESS::ExperimentStatus

An enumeration value representing an experiment that is currently in progress.

source
DearDiary.STOPPEDConstant
STOPPED::ExperimentStatus

An enumeration value representing an experiment that has been stopped.

source
DearDiary.FINISHEDConstant
FINISHED::ExperimentStatus

An enumeration value representing an experiment that has finished.

source
DearDiary.RUNNINGConstant
RUNNING::IterationStatus

An enumeration value representing an Iteration that is still in progress. This is the value assigned when the iteration is created.

source
DearDiary.FAILEDConstant
FAILED::IterationStatus

An enumeration value representing an Iteration that ended because of an exception. The captured exception text is stored in error_message.

source
DearDiary.KILLEDConstant
KILLED::IterationStatus

An enumeration value representing an Iteration that was terminated externally (operator action, timeout, scheduler kill) rather than by a clean return or an exception.

source

Marker types

Upsert results

DearDiary.UpdatedType
Updated <: UpsertResult

A marker type indicating that a record was successfully updated.

source
DearDiary.UnprocessableType
Unprocessable <: UpsertResult

A marker type indicating that a record violates a constraint and cannot be processed.

source
DearDiary.ErrorType
Error <: UpsertResult

A marker type indicating that an error occurred while creating or updating a record.

source

Permission actions

Error codes

DearDiary.ErrorCodeType
ErrorCode

Marker abstract type for error codes returned in non-2xx response bodies.

Concrete subtypes pair with error_code to produce a stable, frontend-facing identifier (e.g., "NOT_FOUND", "PROJECT_PERMISSION_REQUIRED") that callers can switch on without parsing English messages.

source
DearDiary.NotFoundType
NotFound <: ErrorCode

The requested entity does not exist. Pairs with HTTP 404 Not Found.

source
DearDiary.TokenMissingType
TokenMissing <: ErrorCode

The request did not include an Authorization header. Pairs with HTTP 401 Unauthorized.

source
DearDiary.TokenInvalidType
TokenInvalid <: ErrorCode

The bearer token failed signature validation. Pairs with HTTP 401 Unauthorized.

source
DearDiary.TokenExpiredType
TokenExpired <: ErrorCode

The bearer token's exp claim is in the past. Pairs with HTTP 401 Unauthorized.

source
DearDiary.UserNotFoundType
UserNotFound <: ErrorCode

The user identified by the credentials or token does not exist. Pairs with HTTP 401/404 depending on context.

source
DearDiary.ConflictType
Conflict <: ErrorCode

A unique-constraint violation: the resource already exists. Pairs with HTTP 409 Conflict.

source
DearDiary.InvalidPayloadType
InvalidPayload <: ErrorCode

The request payload violates a constraint (foreign key, check, missing field). Pairs with HTTP 422 Unprocessable Entity.

source
DearDiary.ServerErrorType
ServerError <: ErrorCode

Generic catch-all for unexpected failures. Pairs with HTTP 500 Internal Server Error.

source

Pagination

DearDiary.PaginationType
Pagination

Cursor for windowing a collection of records.

Fields

  • limit::Int64: Maximum number of records to return (capped at the route boundary).
  • offset::Int64: Number of records to skip before the page starts.
source
DearDiary.PaginatedResponseType
PaginatedResponse{T} <: ResultType

Envelope returned by paginated list endpoints.

Fields

  • data::Array{T,1}: The records in this page.
  • total::Int64: Total number of matching records (across all pages).
  • limit::Int64: The page size used.
  • offset::Int64: The offset used.
source