Class CreateIndexGenerator

    • Constructor Detail

      • CreateIndexGenerator

        public CreateIndexGenerator()
    • Method Detail

      • validate

        public ValidationErrors validate​(CreateIndexStatement createIndexStatement,
                                         Database database,
                                         SqlGeneratorChain sqlGeneratorChain)
        Description copied from interface: SqlGenerator
        Validate the data contained in the SqlStatement. If there are no errors, return an empty ValidationErrors object, not a null value. Liquibase will inspect the ValidationErrors result before attempting to call generateSql.
      • generateSql

        public Sql[] generateSql​(CreateIndexStatement statement,
                                 Database database,
                                 SqlGeneratorChain sqlGeneratorChain)
        Generate a CREATE INDEX SQL statement. Here, we are walking on thin ice, because the SQL Foundation standard (ISO/IEC 9075-2) does not concern itself with indexes at all and leaves them as an implementation-specific detail at the discretion of each RDBMS vendor. However, there is some common ground to most RDBMS, and we try to make an educated guess on how a CREATE INDEX statement might look like if we have no specific handler for the DBMS.
        Parameters:
        statement - A CreateIndexStatement with the desired properties of the SQL to be generated
        database - The DBMS for whose SQL dialect the statement is to be made
        sqlGeneratorChain - The other SQL generators in the same chain (but this method is not interested in them)
        Returns:
        An array of Sql objects containing the generated SQL statement(s).