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 ExasolScriptManager method createOrReplaceScriptQuery.
private void createOrReplaceScriptQuery(List<DBEPersistAction> actions, ExasolScript script, Boolean replace) {
actions.add(new SQLDatabasePersistAction("Create Script", "OPEN SCHEMA " + script.getSchema().getName()));
if (replace) {
actions.add(new SQLDatabasePersistAction("Create Script", "DROP SCRIPT " + script.getFullyQualifiedName(DBPEvaluationContext.DDL)));
}
actions.add(new SQLDatabasePersistAction("Create Script: ", script.getSql(), true));
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class ExasolTableColumnManager method addObjectModifyActions.
// -----
// Alter
// -----
@Override
protected void addObjectModifyActions(List<DBEPersistAction> actionList, ObjectChangeCommand command) {
ExasolTableColumn exasolColumn = command.getObject();
if (!command.getProperties().isEmpty()) {
// build nullability tring
String nullability = "";
if (exasolColumn.isOriRequired() != null && exasolColumn.isOriRequired() != exasolColumn.isRequired())
nullability = exasolColumn.isRequired() ? "NOT NULL" : "NULL";
final String deltaSQL = exasolColumn.getName() + " " + exasolColumn.getFormatType() + " " + (exasolColumn.getDefaultValue() == null ? "" : " DEFAULT " + exasolColumn.getDefaultValue()) + " " + formatIdentiy(exasolColumn.isAutoGenerated(), exasolColumn.getIdentityValue()) + " " + nullability;
if (!deltaSQL.isEmpty()) {
String sqlAlterColumn = String.format(SQL_ALTER, exasolColumn.getTable().getFullyQualifiedName(DBPEvaluationContext.DDL), deltaSQL);
actionList.add(new SQLDatabasePersistAction(CMD_ALTER, sqlAlterColumn));
}
}
// Comment
DBEPersistAction commentAction = buildCommentAction(exasolColumn);
if (commentAction != null) {
actionList.add(commentAction);
}
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class SQLConstraintManager 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_constraint, "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 SQLForeignKeyManager 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_foreign_key, //$NON-NLS-1$ //$NON-NLS-2$
"ALTER TABLE " + table.getFullyQualifiedName(DBPEvaluationContext.DDL) + " ADD " + getNestedDeclaration(table, command)));
}
Aggregations