Generic method to build an entity from postgresql database results, since the postgresql database may not return results.
Generic method to build an entity from postgresql database results, since the postgresql database may not return results.
the type of entity to be built
an optional ResultSet returned from the database
a function that can build entities of type A from a RowData object
a disjunction containing either a RepositoryError.Fail, or an object of type A
Generic method to build a list of entities from postgresql database results, since the postgresql database may not return results.
Generic method to build a list of entities from postgresql database results, since the postgresql database may not return results.
TODO: check in which case the database driver will return "None" instead of Some(ResultSet)
the type of entity to be built
an optional ResultSet returned from the database
a function that can build entities of type A from a RowData object
a disjunction containing either a RepositoryError.Fail, or an object of type A
Delete all work for a given task.
Delete all work for a given task. Delete all revisions for MultipleChoice, Ordering, Matcing works and for DocumentWork we delete only in Work table and don't touch Documents table, that should be done in DocumentRepository
This is needed when we want to delete the task itself... before that can be done, all that task's work must itself be deleted.
Delete all revisions of a work.
Delete all revisions of a work.
Find a specific revision for a single work for a user.
Find a specific revision for a single work for a user.
Find the latest revision of a single work for a user within a Task.
Find the latest revision of a single work for a user within a Task.
Find a specific revision of a single work.
Find a specific revision of a single work.
Find the latest revision of a single work.
Find the latest revision of a single work.
Insert a new work into the database.
Insert a new work into the database.
This explicitly inserts a new, fresh work. To insert a new revision for an existing work, use the update method.
Since all work types have the same fields (varying only by the type of 'answer')
List latest revisions of a specific work for all users within a Task.
List latest revisions of a specific work for all users within a Task.
List all revisions of a specific work for a user within a Task.
List all revisions of a specific work for a user within a Task.
List the latest revision of work for each task in a project for a user.
List the latest revision of work for each task in a project for a user.
Send a query to the database and retrieve a list of entities.
Send a query to the database and retrieve a list of entities.
Send query to the database and compare the number of rows affected.
Send query to the database and compare the number of rows affected.
Send query to the database and retrieve a single entity.
Send query to the database and retrieve a single entity.
Update a work.
Update a work.
By default, updating a work inserts a new revision, but it can optionally update an existing revision (for example, if the domain logic only calls for new revisions after some other condition has been satisfied, like an amount of time passing since the previous revision.