use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class PostgreProcedureManager method addObjectDeleteActions.
@Override
protected void addObjectDeleteActions(List<DBEPersistAction> actions, ObjectDeleteCommand command) {
String objectType = command.getObject().getProcedureTypeName();
actions.add(//$NON-NLS-2$
new SQLDatabasePersistAction("Drop procedure", "DROP " + objectType + " " + command.getObject().getFullQualifiedSignature()));
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class PostgreSchemaManager method addObjectCreateActions.
@Override
protected void addObjectCreateActions(List<DBEPersistAction> actions, ObjectCreateCommand command) {
final PostgreSchema schema = command.getObject();
final StringBuilder script = new StringBuilder("CREATE SCHEMA " + DBUtils.getQuotedIdentifier(schema));
try {
final PostgreRole owner = schema.getOwner(VoidProgressMonitor.INSTANCE);
if (owner != null) {
script.append("\nAUTHORIZATION ").append(owner.getName());
}
} catch (DBException e) {
log.error(e);
}
actions.add(//$NON-NLS-2$
new SQLDatabasePersistAction("Create schema", script.toString()));
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class OracleSequenceManager method addObjectModifyActions.
@Override
protected void addObjectModifyActions(List<DBEPersistAction> actionList, ObjectChangeCommand command) {
String sql = buildStatement(command.getObject(), true);
actionList.add(new SQLDatabasePersistAction("Alter Sequence", sql));
String comment = buildComment(command.getObject());
if (comment != null) {
actionList.add(new SQLDatabasePersistAction("Comment on Sequence", comment));
}
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class OracleSequenceManager method addObjectCreateActions.
@Override
protected void addObjectCreateActions(List<DBEPersistAction> actions, ObjectCreateCommand command) {
String sql = buildStatement(command.getObject(), false);
actions.add(new SQLDatabasePersistAction("Create Sequence", sql));
String comment = buildComment(command.getObject());
if (comment != null) {
actions.add(new SQLDatabasePersistAction("Comment on Sequence", comment));
}
}
use of org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction in project dbeaver by serge-rider.
the class OracleTableTriggerManager method createOrReplaceTriggerQuery.
protected void createOrReplaceTriggerQuery(List<DBEPersistAction> actions, OracleTableTrigger trigger) {
String source = OracleUtils.normalizeSourceName(trigger, false);
if (source == null) {
return;
}
//$NON-NLS-2$
actions.add(new SQLDatabasePersistAction("Create trigger", "CREATE OR REPLACE " + source, true));
OracleUtils.addSchemaChangeActions(actions, trigger);
}
Aggregations