pypushflow.persistence.init_db_client#

pypushflow.persistence.init_db_client(*args, db_type=None, **kwargs)[source]#

Initializes a database client based on the specified db_type.

Parameters:
  • db_type (Optional[str]) –

    The type of database client to initialize. If not specified, defaults to DEFAULT_DB_TYPE. Supported values include:

    • ”besdb”: Requires the following additional parameters: - url (str): URL for connecting to the BES database. - initiator (str): Initiator from which the request originates. - host (str): Hostname from which the request originates. - port (int): Port number from which the request originates. - request_id (str): Unique identifier for the request.

    • ”pymongo”: Requires the following additional parameters: - url (str): Connection URL for the MongoDB instance. - database (str): Name of the database to access. - collection (str): Name of the collection within the database.

    • ”memory”: An in-memory database type. No additional parameters required.

    • ”dummy”: A placeholder database type for testing or development purposes. No additional parameters required.

  • args – see db_type.

  • kwargs – see db_type.

Return type:

WorkflowDbClient

Returns:

An instance of WorkflowDbClient specific to the specified db_type.