Interface SqlGet

All Known Implementing Classes:
JdbcExecutor, MariaDb, MsSQL, MySQL, OracleDb, PostgreSQL

public interface SqlGet
Defines operations for executing SQL SELECT queries.

Implementations of this interface are responsible for performing read-only database operations that retrieve data without modifying the database state, such as get data for asserts or reports.

This interface should contain only non-mutating operations. All data-changing SQL commands must be handled by SqlPost.

  • Method Details

    • seeRowsCountInTableExactly

      void seeRowsCountInTableExactly(String tableName, Object[][] conditionsArray, int expectedCount)
      Assert of records EXACTLY count by conditions with await
      Parameters:
      tableName - schema_name.table_name
      conditionsArray - Object[][] with template {{"column1", "value1"},...}
      expectedCount - expected rows count
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRowsCountInTableExactlyCustom

      void seeRowsCountInTableExactlyCustom(String tableName, String conditions, int expectedCount)
      Assert of records EXACTLY count by conditions with await
      Parameters:
      tableName - schema_name.table_name
      conditions - String "where id=1"
      expectedCount - expected rows count
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRowsCountInTableExactly

      void seeRowsCountInTableExactly(String tableName, int expectedCount)
      Assert of records EXACTLY count with await
      Parameters:
      tableName - schema_name.table_name
      expectedCount - expected rows count
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRowsCountInTableExactly

      void seeRowsCountInTableExactly(String tableName, String providedJson, int expectedCount)
      Assert of records EXACTLY count with await

      Use custom sql conditions only if it`s necessary, otherwise use seeRowsCountInTableExactly(java.lang.String, java.lang.Object[][], int)

      Parameters:
      tableName - schema_name.table_name
      providedJson - String with json """{"column1": "test_value1", ...}"""
      support up to 2 options in key after field
      "CREATE_DATE:>="
      "CREATE_DATE:=:TIMESTAMP" (for oracleDd)
      expectedCount - expected rows count
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRowsCountInTableExactly

      void seeRowsCountInTableExactly(String tableName, Object[][] conditionsArray, int expectedCount, int awaitMs)
      Assert of records EXACTLY count by conditions with custom await
      Parameters:
      tableName - schema_name.table_name
      conditionsArray - Object[][] with template {{"column1", "value1"},...}
      expectedCount - expected rows count
      awaitMs - await in ms
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRowsCountInTableExactlyCustom

      void seeRowsCountInTableExactlyCustom(String tableName, String conditions, int expectedCount, int awaitMs)
      Assert of records EXACTLY count by conditions with custom await
      Parameters:
      tableName - schema_name.table_name
      conditions - String "where id=1"
      expectedCount - expected rows count
      awaitMs - await in ms
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRowsCountInTableExactly

      void seeRowsCountInTableExactly(String tableName, int expectedCount, int awaitMs)
      Assert of records EXACTLY count with custom await
      Parameters:
      tableName - schema_name.table_name
      expectedCount - expected rows count
      awaitMs - await in ms
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeTableIsEmpty

      void seeTableIsEmpty(String tableName)
      Assert That table has at least one record with await
      Parameters:
      tableName - schema_name.table_name
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeTableDoesNotEmpty

      void seeTableDoesNotEmpty(String tableName)
      Assert That table has no records with await
      Parameters:
      tableName - schema_name.table_name
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRecordExistsInTable

      void seeRecordExistsInTable(String tableName, Object[][] conditionsArray)
      Assert that exists at least one record by conditions with await
      Parameters:
      tableName - schema_name.table_name
      conditionsArray - Object[][] with template {{"column1", "value1"},...}
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRecordExistsInTable

      void seeRecordExistsInTable(String tableName, String providedJson)
      Assert that exists at least one record by conditions with await
      Parameters:
      tableName - schema_name.table_name
      providedJson - String with json """{"column1": "test_value1", ...}"""
      support up to 2 options in key after field
      "CREATE_DATE:>="
      "CREATE_DATE:=:TIMESTAMP" (for oracleDd)
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • seeRecordExistsInTableCustom

      void seeRecordExistsInTableCustom(String tableName, String conditions)
      Assert that exists at least one record by conditions with await

      Use custom sql conditions only if it`s necessary, otherwise use seeRecordExistsInTable(java.lang.String, java.lang.Object[][])

      Parameters:
      tableName - schema_name.table_name
      conditions - String "where id=1"
      Throws:
      org.awaitility.core.ConditionTimeoutException - on assert fail (and adds Allure attachments)
    • showDataFromTable

      void showDataFromTable(String tableName)
      Method to create attachment with all rows by all columns in table
      Parameters:
      tableName - schema_name.table_name
    • showDataByCondition

      void showDataByCondition(String tableName, Object[][] conditionsArray)
      Method to show full record/records by condition if exists
      Parameters:
      tableName - schema_name.table_name
      conditionsArray - Object[][] with conditions {{"ID", "1"}, {"NAME", "Alex"}}
      Throws:
      org.awaitility.core.ConditionTimeoutException - if record/s not found by conditions