MessageRepository module

class repositories.message_repository.MessageRepository(db_name: str = 'concord.db')

Bases: repositories.repository_interface.RepositoryInterface

delete_by_message_id(message_id: str)bool
delete_by_receiver_id(receiver_id: str)bool
delete_by_sender_id(sender_id: str)bool
find_all_by_message_id(message_id: str)Tuple[List[dtos.dto_message.Message], bool]
find_all_by_receiver_id(receiver_id: str)Tuple[List[dtos.dto_message.Message], bool]
find_all_by_sender_id(sender_id: str)Tuple[List[dtos.dto_message.Message], bool]
find_all_by_sender_id_and_receiver_id(sender_id: str, receiver_id: str)Tuple[List[dtos.dto_message.Message], bool]
find_by_message_id(message_id: str)Tuple[dtos.dto_message.Message, bool]
find_by_receiver_id(receiver_id: str)Tuple[dtos.dto_message.Message, bool]
find_by_sender_id(sender_id: str)Tuple[dtos.dto_message.Message, bool]
put(message: dtos.dto_message.Message)bool

Puts an object on the database

Parameters

subject – the subject to be stored on the database

Returns

any

update_by_message_id(message_id: str, new_data: dtos.dto_message.Message)bool
update_by_receiver_id(receiver_id: str, new_data: dtos.dto_message.Message)bool
update_by_sender_id(sender_id: str, new_data: dtos.dto_message.Message)bool