DbUnify.SQLite3.sync.Live package

Submodules

DbUnify.SQLite3.sync.Live.LiveEvents module

DbUnify.SQLite3.sync.Live.LiveEvents.add_event_handler(event_name: str, handler: Callable)[source]

Add a handler function for a specific event.

DbUnify.SQLite3.sync.Live.LiveEvents.register_event(event_name: str)[source]

Register an event name for event handlers.

DbUnify.SQLite3.sync.Live.LiveEvents.trigger_event(event_name: str, *args, **kwargs)[source]

Trigger all handlers associated with an event.

DbUnify.SQLite3.sync.Live.LiveException module

exception DbUnify.SQLite3.sync.Live.LiveException.DatabaseAccessException(message: str)[source]

Bases: LiveManagerException

Exception raised for errors accessing the database.

exception DbUnify.SQLite3.sync.Live.LiveException.EventHandlingException(message: str)[source]

Bases: LiveManagerException

Exception raised for errors in event handling.

exception DbUnify.SQLite3.sync.Live.LiveException.LiveManagerException[source]

Bases: Exception

Base exception class for LiveManager.

exception DbUnify.SQLite3.sync.Live.LiveException.LogWriteException(message: str)[source]

Bases: LiveManagerException

Exception raised for errors writing to the log file.

exception DbUnify.SQLite3.sync.Live.LiveException.SchemaChangeException(message: str)[source]

Bases: LiveManagerException

Exception raised for errors detecting schema changes.

DbUnify.SQLite3.sync.Live.LiveManager module

class DbUnify.SQLite3.sync.Live.LiveManager.LiveManager(db_name: str, event_ttl: float, cache_ttl: int = 300)[source]

Bases: object

register_callback(event: str, callback: Callable)[source]

Register a callback for a specific event.

Parameters:
  • event (str) – The event to register the callback for.

  • callback (Callable) – The callback function to register.

restart()[source]

Restart monitoring the database.

run()[source]

Continuously monitor the database for changes.

start()[source]

Start monitoring the database.

stop()[source]

Stop monitoring the database.

DbUnify.SQLite3.sync.Live.obj module

class DbUnify.SQLite3.sync.Live.obj.Attribute(timestamp: str, db_name: str, table_name: str, operation: str, command: str, details: dict)[source]

Bases: object

to_dict() Dict[source]

Convert the Attribute object to a dictionary.

Module contents