Class MariaDb

All Implemented Interfaces:
SqlConfig<MariaDb>, SqlGet, SqlPost

public class MariaDb extends JdbcExecutor<MariaDb>
Class for interacting with MariaDB

For one instance run recommended: MariaDb db = MariaDb.getInstance()

Contains methods for:

asserts with await, change data (create, update, clean)
more info JdbcExecutor
  • Field Details

  • Constructor Details

    • MariaDb

      public MariaDb(String dbUrl, String username, String passwd)
      Creates a new MariaDb database helper instance with the specified connection parameters.
      Parameters:
      dbUrl - the JDBC connection URL for the MariaDb database
      username - the username used to authenticate with the database
      passwd - the password used to authenticate with the database
      Throws:
      IllegalArgumentException - if any of the required parameters are null or empty
    • MariaDb

      public MariaDb()
      Constructs MariaDB client configuration.

      Loads configuration values from a YAML file.

      more info JdbcExecutor(String dbType, String getColumnsQuery)
  • Method Details

    • getInstance

      public static MariaDb getInstance()
      Returns the instance of MariaDb with config builder MariaDb().

      This implementation is thread-safe using method-level synchronization.

      Returns:
      the singleton instance of MariaDb
    • assertCountInTableBuilder

      @Step("(DB)[ASSERT] Count records in {tableName} {conditions} EQUAL {expectedCount}") protected void assertCountInTableBuilder(String tableName, String conditions, @Param(mode=HIDDEN) Object[][] conditionsArray, String expectedCount, @Param(mode=HIDDEN) int awaitMs)
    • recordExistsBuilder

      @Step("(DB)[ASSERT] Record/s exists in {tableName} {conditions}") protected void recordExistsBuilder(String tableName, String conditions, @Param(mode=HIDDEN) Object[][] conditionsArray, @Param(mode=HIDDEN) int awaitMs)
    • showDataFromTableMethod

      protected void showDataFromTableMethod(String tableName)
    • seeInDbByCondMethod

      @Step("(DB)[ASSERT] Records exists in {tableName}: {conditions}") protected void seeInDbByCondMethod(String tableName, String conditions)
    • getTableColumns

      protected String[] getTableColumns(String tableName)
      Get array with table column list
      Parameters:
      tableName - table name
      Returns:
      Strings... with columns names