Class ParsedSqlStatement
java.lang.Object
migratedb.v1.core.internal.sqlscript.ParsedSqlStatement
- All Implemented Interfaces:
SqlStatement
- Direct Known Subclasses:
PostgreSQLCopyParsedStatement
A sql statement from a script that can be executed at once against a database.
-
Constructor Summary
ConstructorsConstructorDescriptionParsedSqlStatement(int pos, int line, int col, String sql, Delimiter delimiter, boolean canExecuteInTransaction) -
Method Summary
-
Constructor Details
-
ParsedSqlStatement
-
-
Method Details
-
getPos
public int getPos() -
getLine
public int getLine() -
getCol
public int getCol() -
getLineNumber
public final int getLineNumber()- Specified by:
getLineNumberin interfaceSqlStatement- Returns:
- The original line number where the statement was located in the script it came from.
-
getSql
- Specified by:
getSqlin interfaceSqlStatement- Returns:
- The sql to send to the database.
-
getDelimiter
- Specified by:
getDelimiterin interfaceSqlStatement- Returns:
- The delimiter for the statement.
-
canExecuteInTransaction
public boolean canExecuteInTransaction()Description copied from interface:SqlStatementWhether the execution should take place inside a transaction. Almost all implementation should returntrue. This however makes it possible to execute certain migrations outside a transaction. This is useful for databases like PostgreSQL and SQL Server where certain statement can only execute outside a transaction.- Specified by:
canExecuteInTransactionin interfaceSqlStatement- Returns:
trueif a transaction should be used (highly recommended), orfalseif not.
-
execute
Description copied from interface:SqlStatementExecutes this statement against the database.- Specified by:
executein interfaceSqlStatement- Parameters:
jdbcTemplate- The jdbcTemplate to use to execute this script.- Returns:
- the result of the execution.
-