RDBMS Adapters
Within the Lazsa Platform there are two fundamental interfaces designed to handle interactions with various Relational Database Management Systems (RDBMS).
The diagram depicts the relation between interfaces and the classes.
Refer to the sections below for details of all the implementations.
RelationalDataSourceGenericRepository
Intent: The interface encapsulates common database operations that can be performed on different relational databases. The methods are designed to interact with data, retrieve information about tables and metadata, and assist in query generation.
Usage: The methods defined in this interface can be implemented by various classes to provide database-specific functionality. These implementations should cater to different relational database systems (e.g., MySQL, PostgreSQL, etc.) while adhering to the methods' signatures and functionalities.
The different methods and their usages are as follows:
-
getTablelist
-
Purpose: This method is intended to retrieve a list of table names from a relational database.
-
Input: An instance of RdsOrchestratorBean which likely contains information about the database connection.
-
Output: A list of string containing the names of tables present in the database.
-
Throws: SQLException if there's an issue while interacting with the database.
-
-
getTableDescription
-
Purpose: This method is used to obtain a description of a specific table from the database.
-
Input: An instance of RdsOrchestratorBean containing information about the database and the target table.
-
Output: A TableDescription object describing the structure and attributes of the specified table.
-
Throws: SQLException if there's an issue while querying the database.
-
-
getJoinedPreview
-
Purpose: This method is used to provide a preview of joined data from multiple tables.
-
Input: An instance of RdsOrchestratorBean with relevant information for creating a join.
-
Output: A TableDescription object containing details about the joined data.
-
Throws SQLException if there's an issue with the database query.
-
-
generatequery
-
Purpose: This method is used to provide a preview of joined data from multiple tables.
-
Input: An instance of RdsOrchestratorBean with relevant information for creating a join.
-
Output: A TableDescription object containing details about the joined data.
-
Throws: SQLException if there's an issue while querying the database.
-
-
getTableDescriptionFromQuery
-
Purpose: This method is used to retrieve a TableDescription from a custom query provided in the RdsOrchestratorBean.
-
Input: An instance of RdsOrchestratorBean containing the custom query.
-
Output: A TableDescription object describing the structure of data resulting from the query.
-
Throws: SQLException if there's an issue while querying the database.
-
-
fetchMetadata
-
Purpose: This method is to fetch metadata details from the database.
-
Input: An instance of RdsOrchestratorBean containing database and other relevant information.
-
Output: A list of MetadataDetails objects containing metadata information.
-
Throws: SQLException, IOException, JSchException, SftpException if there are issues during metadata retrieval.
-
-
throwIfInvalidDatastore (default method)
-
Purpose: This method is used to check if the provided ElabDatastoreBean has any empty properties and throws an exception if found.
-
Input: An ElabDatastoreBean containing attributes like host, port, database name, username, and password.
-
Output: A boolean indicating whether any empty properties were found.
-
Throws: An IllegalArgumentException, if any required attribute is empty.
-
RDBMSMetadataHelper
The interface provides methods to assist in retrieving metadata and information from an RDBMS (Relational Database Management System). It seems to focus on methods related to querying data, obtaining connection information, and interacting with database metadata.
The different methods and their usages are as follows:
-
getQueryData (default method)
-
Purpose: This method is used to retrieve query data from the database, based on the provided RdsOrchestratorBean.
-
Input: An instance of RdsOrchestratorBean containing query-related information.
-
Output: A list of Map objects, where each map represents a row of data returned by the query. The keys in the map represent column names, and values represent column values.
-
Throws: SQL exception if there is an issue while querying the database.
-
-
getTables (default method)
-
Purpose: This method is used to retrieve a list of table names from the specified database.
-
Input: An instance of ElabDataStoreBeanWithAttributesMap containing database connection attributes, and driver and driverName strings.
-
Output A list of strings containing the names of tables present in the database.
-
Throws: SQL exception if there is an issue while querying the database.
-
-
getConnection (default method)
-
Purpose: This method is used to establish a database connection using the provided driver and host URL.
-
Input: A string representing the database driver and another String representing the host URL.
-
Output: A connection object representing the established database connection.
-
Throws: SQL exception if there is an issue while querying the database.
-
-
createConnectionURL (default method)
-
Purpose: This method is used to create a connection URL based on the given connection type and ElabDataStoreBeanWithAttributesMap.
-
Input: A string representing the connection type and an instance of ElabDataStoreBeanWithAttributesMap containing connection attributes.
-
Output: A string representing the created connection URL.
-
-
formatConnectionURL (default method)
-
Purpose: This method is to format the given connection URL with the attributes from the ElabDataStoreBeanWithAttributesMap.
-
Input: A string representing the connection URL and an instance of ElabDataStoreBeanWithAttributesMap containing connection attributes.
-
Output: A string representing the formatted connection URL.
-
-
getResultSetTableMap (default method)
-
Purpose: This method is used to retrieve a mapping of table names to result sets based on the specified database and driver.
-
Input: An instance of ElabDataStoreBeanWithAttributesMap containing database connection attributes, and driver and driverName strings.
-
Output: A map where keys are table names and values are List of ResultMap objects, each representing a result set.
-
-
getConfiguredSourceTables (default method)
-
Purpose: This method is to retrieve a set of table names configured as data sources.
-
Input: An instance of ElabDataStoreBeanWithAttributesMap containing connection attributes.
-
Output: A set of strings containing the names of configured source tables.
-
The interfaces listed above serve as blueprints of the functionality that is implemented by concrete classes. Each of these classes offers their own tailored implementation of the required methods based on the specific database technology they are designed for. In cases where a technology-specific implementation is not available, a default implementation is provided.
Let us delve into some concrete classes:
-
GenericMSSQLRepositoryImpl: This class encapsulates methods dedicated to performing operations on Microsoft SQL Server (MSSQL) databases.
-
GenericMariaDBRepositoryImpl: Within this class, you'll find a collection of methods tailored for interacting with MariaDB databases.
-
GenericOracleDbRepositoryImpl: For tasks involving Oracle Database, this class supplies relevant methods.
-
GenericMysqlRepositoryImpl: If your operations target MySQL databases, this class provides suitable methods.
-
GenericAWSS3RepositoryImpl: With a focus on Amazon Web Services (AWS) S3 operations, this class furnishes the necessary methods.
These classes were crafted with meticulous attention to the intricacies of each respective database technology, ensuring efficient and accurate interactions. The Lazsa Platform benefits from these interfaces and their corresponding implementations, allowing us to seamlessly manage interactions with a diverse array of RDBMS technologies, each optimized for their specific capabilities and requirements.
What's next?Data Crawler Adapters |