Class ParserSqlScript

    • Field Detail

      • sqlStatements

        protected final List<SqlStatement> sqlStatements
        The sql statements contained in this script.
      • resource

        protected final Resource resource
        The resource containing the statements.
      • parser

        protected final Parser parser
    • Constructor Detail

      • ParserSqlScript

        public ParserSqlScript​(Parser parser,
                               Resource resource,
                               Resource metadataResource,
                               boolean mixed)
        Creates a new sql script from this source.
        Parameters:
        resource - The sql script resource.
        metadataResource - The sql script metadata resource.
        mixed - Whether to allow mixing transactional and non-transactional statements within the same migration.
    • Method Detail

      • parse

        protected void parse()
      • validate

        public void validate()
        Description copied from interface: SqlScript
        Validates this SQL script.
        Specified by:
        validate in interface SqlScript
      • getSqlStatementCount

        public int getSqlStatementCount()
        Specified by:
        getSqlStatementCount in interface SqlScript
        Returns:
        The number of sql statements contained in this script.
      • getResource

        public final Resource getResource()
        Specified by:
        getResource in interface SqlScript
        Returns:
        The resource containing the statements.
      • executeInTransaction

        public boolean executeInTransaction()
        Description copied from interface: SqlScript
        Whether the execution should take place inside a transaction. This is useful for databases like PostgreSQL where certain statement can only execute outside a transaction.
        Specified by:
        executeInTransaction in interface SqlScript
        Returns:
        true if a transaction should be used (highly recommended), or false if not.
      • shouldExecute

        public boolean shouldExecute()
        Description copied from interface: SqlScript
        Whether the script should execute or not.
        Specified by:
        shouldExecute in interface SqlScript
        Returns:
        true if the script should execute, or false if not.