exasol / virtual-schema-common-jdbc

Common module for JDBC-based access from Virtual Schemas
MIT License
0 stars 1 forks source link

Enable dialects to add property validators #138

Closed ckunki closed 1 year ago

ckunki commented 1 year ago

VSEXA for example in method

Currently class ExasolSqlDialectin VSEXA overrides method AbstractSqlDialect .validateProperties() to perform additional validations for additional properties specific to this SQL dialect:

  @Override
    public void validateProperties() throws PropertyValidationException {
        super.validateProperties();
        checkImportPropertyConsistency(EXASOL_IMPORT_PROPERTY, EXASOL_CONNECTION_PROPERTY);
        validateBooleanProperty(EXASOL_IMPORT_PROPERTY);
        validateBooleanProperty(IS_LOCAL_PROPERTY);
    }

https://github.com/exasol/exasol-virtual-schema/blob/main/src/main/java/com/exasol/adapter/dialects/exasol/ExasolSqlDialect.java#L140

In future it should be sufficient to add validators to the existing validator chain already used by AbstractSqlDialect. Currently this is not possible, since the chain is private. The current ticket therefore proposes to add a protected method to class AbstractSqlDialect enabling each dialect to add additional property validators in its constructor.