Skip to main content
Version: 0.9.5

MariaDBSource

class MariaDBSource(
uri: str,
query: str | List[str],
credentials: dict | UserPasswordCredentials | None = None,
initial_values: dict | None = None,
)

Bases: Input

Categories: source

Class for managing the configuration of MariaDB-based data inputs.

Attributes: credentials (UserPasswordCredentials): The credentials required to access the MariaDB database. initial_values (dict): The initial values for the parameters in the SQL queries. query (str | List[str]): The SQL query(s) to execute. If multiple queries are provided, they must be provided as a dictionary, with the parameter name in the registered function as the key and the SQL query as the value. uri (str): The URI of the database where the data is located.

Methods: to_dict(): Converts the MariaDBSource object to a dictionary.

Initializes the MariaDBSource with the given URI and query, and optionally connection credentials and initial values for the parameters in the SQL queries.

Parameters

parameter
uristr

The URI of the database where the data is located

parameter
querystr | List[str]

The SQL query(s) to execute. If multiple queries are provided, they must be provided as a list, and they will be mapped to the function inputs in the same order as they are defined.

parameter
credentialsdict | UserPasswordCredentials, optional

The credentials required to access the MariaDB database. Can be a dictionary or a UserPasswordCredentials object.

parameter
initial_valuesdict, optional

The initial values for the parameters in the SQL queries.

Raises

InputConfigurationError

Properties

property
credentialsUserPasswordCredentials | None

The credentials required to access MariaDB. If no credentials were provided, it will return None.

property
initial_valuesdict

The initial values for the parameters in the SQL queries.

property
querystr | List[str]

The SQL query(s) to execute.

property
uristr

The URI of the database where the data is located.

Methods

to_dict
def to_dict() -> dict

Converts the MariaDBSource object to a dictionary with all the relevant information.

Returns:

dict: A dictionary with the relevant information of the MariaDBSource object.