Interface PipelineSQLBuilder

  • All Superinterfaces:
    org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI

    public interface PipelineSQLBuilder
    extends org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI
    Pipeline SQL builder.
    • Method Detail

      • buildCreateSchemaSQL

        default Optional<String> buildCreateSchemaSQL​(String schemaName)
        Build create schema SQL.
        Parameters:
        schemaName - schema name
        Returns:
        create schema SQL
      • buildDivisibleInventoryDumpSQL

        String buildDivisibleInventoryDumpSQL​(String schemaName,
                                              String tableName,
                                              List<String> columnNames,
                                              String uniqueKey)
        Build divisible inventory dump SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        columnNames - column names
        uniqueKey - unique key
        Returns:
        divisible inventory dump SQL
      • buildDivisibleInventoryDumpSQLNoEnd

        String buildDivisibleInventoryDumpSQLNoEnd​(String schemaName,
                                                   String tableName,
                                                   List<String> columnNames,
                                                   String uniqueKey)
        Build divisible inventory dump SQL without end value.
        Parameters:
        schemaName - schema name
        tableName - table name
        columnNames - column names
        uniqueKey - unique key
        Returns:
        divisible inventory dump SQL without end value
      • buildIndivisibleInventoryDumpSQL

        String buildIndivisibleInventoryDumpSQL​(String schemaName,
                                                String tableName,
                                                List<String> columnNames,
                                                String uniqueKey)
        Build indivisible inventory dump first SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        columnNames - column names
        uniqueKey - unique key
        Returns:
        indivisible inventory dump SQL
      • buildNoUniqueKeyInventoryDumpSQL

        String buildNoUniqueKeyInventoryDumpSQL​(String schemaName,
                                                String tableName)
        Build no unique key inventory dump SQL.
        Parameters:
        schemaName - schema name
        tableName - tableName
        Returns:
        inventory dump all SQL
      • buildInsertSQL

        String buildInsertSQL​(String schemaName,
                              DataRecord dataRecord)
        Build insert SQL.
        Parameters:
        schemaName - schema name
        dataRecord - data record
        Returns:
        insert SQL
      • buildUpdateSQL

        String buildUpdateSQL​(String schemaName,
                              DataRecord dataRecord,
                              Collection<Column> conditionColumns)
        Build update SQL.
        Parameters:
        schemaName - schema name
        dataRecord - data record
        conditionColumns - condition columns
        Returns:
        update SQL
      • extractUpdatedColumns

        List<Column> extractUpdatedColumns​(DataRecord dataRecord)
        Extract updated columns.
        Parameters:
        dataRecord - data record
        Returns:
        filtered columns
      • buildDeleteSQL

        String buildDeleteSQL​(String schemaName,
                              DataRecord dataRecord,
                              Collection<Column> conditionColumns)
        Build delete SQL.
        Parameters:
        schemaName - schema name
        dataRecord - data record
        conditionColumns - condition columns
        Returns:
        delete SQL
      • buildDropSQL

        String buildDropSQL​(String schemaName,
                            String tableName)
        Build drop SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        Returns:
        drop SQL
      • buildCountSQL

        String buildCountSQL​(String schemaName,
                             String tableName)
        Build count SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        Returns:
        count SQL
      • buildEstimatedCountSQL

        Optional<String> buildEstimatedCountSQL​(String schemaName,
                                                String tableName)
        Build estimated count SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        Returns:
        estimated count SQL
      • buildUniqueKeyMinMaxValuesSQL

        String buildUniqueKeyMinMaxValuesSQL​(String schemaName,
                                             String tableName,
                                             String uniqueKey)
        Build unique key minimum maximum values SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        uniqueKey - unique key
        Returns:
        min max unique key SQL
      • buildQueryAllOrderingSQL

        String buildQueryAllOrderingSQL​(String schemaName,
                                        String tableName,
                                        List<String> columnNames,
                                        String uniqueKey,
                                        boolean firstQuery)
        Build query all ordering SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        columnNames - column names
        uniqueKey - unique key, it may be primary key, not null
        firstQuery - first query
        Returns:
        query SQL
      • buildCheckEmptySQL

        String buildCheckEmptySQL​(String schemaName,
                                  String tableName)
        Build check empty SQL.
        Parameters:
        schemaName - schema name
        tableName - table name
        Returns:
        check SQL
      • buildCRC32SQL

        default Optional<String> buildCRC32SQL​(String schemaName,
                                               String tableName,
                                               String column)
        Build CRC32 SQL.
        Parameters:
        schemaName - schema name
        tableName - table Name
        column - column
        Returns:
        CRC32 SQL