use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class SQLTableColumnManager method addObjectCreateActions.
@Override
protected void addObjectCreateActions(List<DBEPersistAction> actions, ObjectCreateCommand command) {
final TABLE_TYPE table = command.getObject().getTable();
actions.add(new SQLDatabasePersistAction(ModelMessages.model_jdbc_create_new_table_column, "ALTER TABLE " + table.getFullyQualifiedName(DBPEvaluationContext.DDL) + " ADD " + getNestedDeclaration(table, command)));
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class ExasolViewManager method addObjectDeleteActions.
@Override
protected void addObjectDeleteActions(List<DBEPersistAction> actions, SQLObjectEditor<ExasolView, ExasolSchema>.ObjectDeleteCommand<ExasolView, ExasolSchema> command) {
ExasolView view = (ExasolView) command.getObject();
actions.add(new SQLDatabasePersistAction("Drop view", "DROP VIEW " + view.getFullyQualifiedName(DBPEvaluationContext.DDL)));
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class DB2TableColumnManager method addObjectModifyActions.
// -----
// Alter
// -----
@Override
protected void addObjectModifyActions(List<DBEPersistAction> actionList, ObjectChangeCommand command) {
DB2TableColumn db2Column = command.getObject();
boolean hasColumnChanges = false;
if (!command.getProperties().isEmpty()) {
final String deltaSQL = computeDeltaSQL(command);
if (!deltaSQL.isEmpty()) {
hasColumnChanges = true;
String sqlAlterColumn = String.format(SQL_ALTER, db2Column.getTable().getFullyQualifiedName(DBPEvaluationContext.DDL), deltaSQL);
actionList.add(new SQLDatabasePersistAction(CMD_ALTER, sqlAlterColumn));
}
}
// Comment
DBEPersistAction commentAction = buildCommentAction(db2Column);
if (commentAction != null) {
actionList.add(commentAction);
}
if (hasColumnChanges) {
// Be Safe, Add a reorg action
actionList.add(buildReorgAction(db2Column));
}
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class DB2TableManager method addObjectModifyActions.
// ------
// Alter
// ------
@Override
public void addObjectModifyActions(List<DBEPersistAction> actionList, ObjectChangeCommand command) {
DB2Table db2Table = command.getObject();
if (command.getProperties().size() > 1) {
StringBuilder sb = new StringBuilder(128);
sb.append(SQL_ALTER);
sb.append(db2Table.getFullyQualifiedName(DBPEvaluationContext.DDL));
sb.append(" ");
appendTableModifiers(command.getObject(), command, sb);
actionList.add(new SQLDatabasePersistAction(CMD_ALTER, sb.toString()));
}
DBEPersistAction commentAction = buildCommentAction(db2Table);
if (commentAction != null) {
actionList.add(commentAction);
}
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class OracleSchemaManager method addObjectCreateActions.
@Override
protected void addObjectCreateActions(List<DBEPersistAction> actions, ObjectCreateCommand command) {
OracleUser user = command.getObject().getUser();
actions.add(new SQLDatabasePersistAction("Create schema", "CREATE USER " + DBUtils.getQuotedIdentifier(user) + " IDENTIFIED BY \"" + user.getPassword() + "\""));
}
Aggregations