Search in sources :

Example 11 with PostgreProcedure

use of org.jkiss.dbeaver.ext.postgresql.model.PostgreProcedure in project dbeaver by dbeaver.

the class PostgreProcedureManager method addObjectRenameActions.

@Override
protected void addObjectRenameActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectRenameCommand command, Map<String, Object> options) {
    PostgreProcedure procedure = command.getObject();
    actions.add(new SQLDatabasePersistAction("Rename function", "ALTER " + command.getObject().getProcedureTypeName() + " " + DBUtils.getQuotedIdentifier(procedure.getSchema()) + "." + PostgreProcedure.makeOverloadedName(procedure.getSchema(), command.getOldName(), procedure.getParameters(monitor), true, false) + " RENAME TO " + DBUtils.getQuotedIdentifier(procedure.getDataSource(), command.getNewName())));
}
Also used : PostgreProcedure(org.jkiss.dbeaver.ext.postgresql.model.PostgreProcedure) SQLDatabasePersistAction(org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)

Aggregations

PostgreProcedure (org.jkiss.dbeaver.ext.postgresql.model.PostgreProcedure)11 PostgreDatabase (org.jkiss.dbeaver.ext.postgresql.model.PostgreDatabase)5 PostgreSchema (org.jkiss.dbeaver.ext.postgresql.model.PostgreSchema)5 DBException (org.jkiss.dbeaver.DBException)3 PostgreDataSource (org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource)3 DBNDatabaseNode (org.jkiss.dbeaver.model.navigator.DBNDatabaseNode)3 DBNModel (org.jkiss.dbeaver.model.navigator.DBNModel)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 LabelProvider (org.eclipse.jface.viewers.LabelProvider)2 GridData (org.eclipse.swt.layout.GridData)2 SQLDatabasePersistAction (org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)2 DBNNode (org.jkiss.dbeaver.model.navigator.DBNNode)2 DBSInstance (org.jkiss.dbeaver.model.struct.DBSInstance)2 DBSObject (org.jkiss.dbeaver.model.struct.DBSObject)2 DBSObjectContainer (org.jkiss.dbeaver.model.struct.DBSObjectContainer)2 HashMap (java.util.HashMap)1 IContainer (org.eclipse.core.resources.IContainer)1 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)1 DBPDataSourceContainer (org.jkiss.dbeaver.model.DBPDataSourceContainer)1