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 a user from the database.
Delete a user from the database.
the user to be deleted
a future disjunction containing either the deleted user, or a failure
Find a user by their identifiers.
Find a user by their identifiers.
a String representing their e-mail or username.
a future disjunction containing either the user, or a failure
Find a user by ID.
Find a user by ID.
the UUID of the user to search for.
a future disjunction containing either the user, or a failure
Save a new User.
Save a new User.
Because we're using UUID, we assume we can always successfully create a user. The failure conditions will be things that result in an exception.
the user to insert into the database
a future disjunction containing either the inserted user, or a failure
List users in a given course.
List users in a given course.
a future disjunction containing either the users, or a failure
List all users who have a role.
List all users who have a role.
List users with a specified set of user Ids.
List users with a specified set of user Ids.
an IndexedSeq of UUID of the users to list.
a future disjunction containing either the users, or a failure
List all users.
List all users.
a future disjunction containing either the users, or a failure
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 an existing user.
Update an existing user.
Because you already have a user object, we assume that this user exists in the database and will return the updated user. If your user is out of date, or it's no longer found, an exception should be thrown.
the user to update in the database
a future disjunction containing either the updated user, or a failure