Class AlterStatement
- java.lang.Object
-
- com.mrivanplays.sqlhelper.statement.AlterStatement
-
public final class AlterStatement extends Object
Represents an "ALTER" sql statement.
-
-
Constructor Summary
Constructors Constructor Description AlterStatement(SQLConnectionFactory connectionFactory, Executor async)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AlterStatement
add(String columnName, String type)
Mark the statement to add a column with the specified column name and column typeAlterStatement
alterColumn(String columnName, String type)
Make the statement to modify the specified column name's type to the specified new type.AlterStatement
dropColumn(String columnName)
Mark the statement to drop the column specified.StatementCompletionStage<Void>
executeUpdate()
Executes the updateAlterStatement
table(String tableName)
Mark the statement to execute for the specified table.
-
-
-
Constructor Detail
-
AlterStatement
public AlterStatement(SQLConnectionFactory connectionFactory, Executor async)
-
-
Method Detail
-
table
public AlterStatement table(String tableName)
Mark the statement to execute for the specified table.- Parameters:
tableName
- the table you want to alter's name- Returns:
- this instance for chaining
-
add
public AlterStatement add(String columnName, String type)
Mark the statement to add a column with the specified column name and column type- Parameters:
columnName
- name of the column you want to addtype
- type of the column you want to add- Returns:
- this instance for chaining
-
dropColumn
public AlterStatement dropColumn(String columnName)
Mark the statement to drop the column specified.- Parameters:
columnName
- the column you want to drop's name- Returns:
- this instance for chaining
-
alterColumn
public AlterStatement alterColumn(String columnName, String type)
Make the statement to modify the specified column name's type to the specified new type.- Parameters:
columnName
- the column's name you want to change the typetype
- the new type of the column- Returns:
- this instance for chaining
-
executeUpdate
public StatementCompletionStage<Void> executeUpdate()
Executes the update- Returns:
- completion stage
-
-