Interface SqlScript

All Superinterfaces:
Comparable<SqlScript>
All Known Implementing Classes:
ParserSqlScript

public interface SqlScript extends Comparable<SqlScript>
SQL script containing a series of statements terminated by a delimiter (eg: ;). Single-line (--) and multi-line (/* * /) comments are stripped and ignored.
  • Method Details

    • getSqlStatements

      SqlStatementIterator getSqlStatements()
      Returns:
      The sql statements contained in this script.
    • getSqlStatementCount

      int getSqlStatementCount()
      Returns:
      The number of sql statements contained in this script.
    • getResource

      Resource getResource()
      Returns:
      The resource containing the statements.
    • executeInTransaction

      boolean executeInTransaction()
      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.
      Returns:
      true if a transaction should be used (highly recommended), or false if not.
    • shouldExecute

      boolean shouldExecute()
      Whether the script should execute or not.
      Returns:
      true if the script should execute, or false if not.
    • validate

      void validate()
      Validates this SQL script.