Base
Module that represents the Base repository.
- class BaseRepository(manager, model)[source]
Class that implements the base repository methods.
Default constructor for base repository.
- Parameters:
manager (DatabaseManager) – The database manager instance.
model (Any) – The SQLAlchemy model to use in the repository.
- delete(identifier)[source]
Default method to remove entries from the database.
- Return type:
Note
This method will actually call
updateinternally to update thedeleted_atfield in the table.- Parameters:
identifier (Union[UUID, str]) – The unique identifier to query in the database.
- delete_by_chat_id(chat_id)[source]
Default method to remove entries from the database.
- Return type:
Note
This method will actually call
updateinternally to update thedeleted_atfield in the table.- Parameters:
chat_id (Union[UUID, str]) – The unique identifier to query in the database.
- insert(values)[source]
Default method to make insertions in the database.
- select()[source]
Default method to retrieve information from the database.
- Return type:
- Returns:
Information retrieved from the database
- Return type:
Any
- select_all_by_id(identifier)[source]
Default method to select all entries by filtering using an identifier.
- select_all_by_user_id(user_id)[source]
Default method to select all entries by filtering using an identifier.
- select_by_id(identifier)[source]
Default method to select by filtering using an identifier.
- select_by_name(user_id, name)[source]
Default method to select rows by using a name.
- select_first()[source]
Default method to get first information from the database.
- Return type:
- Returns:
The first information retrieved from the database
- Return type:
Any