提交 92943c91 编写于 作者: S Serge Rider

SQL generation dialog UI fix


Former-commit-id: f5536b51
上级 0f2092b1
......@@ -20,7 +20,6 @@ import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.ext.postgresql.PostgreConstants;
import org.jkiss.dbeaver.ext.postgresql.PostgreUtils;
import org.jkiss.dbeaver.ext.postgresql.PostgreValueParser;
import org.jkiss.dbeaver.model.*;
......@@ -392,15 +391,19 @@ public class PostgreProcedure extends AbstractProcedure<PostgreDataSource, Postg
// No OID so let's use old (bad) way
body = this.procSrc;
} else {
try (JDBCSession session = DBUtils.openMetaSession(monitor, this, "Read procedure body")) {
body = JDBCUtils.queryString(session, "SELECT pg_get_functiondef(" + getObjectId() + ")");
} catch (SQLException e) {
if (!CommonUtils.isEmpty(this.procSrc)) {
log.debug("Error reading procedure body", e);
// At least we have it
body = this.procSrc;
} else {
throw new DBException("Error reading procedure body", e);
if (isAggregate) {
body = "-- Aggregate function";
} else {
try (JDBCSession session = DBUtils.openMetaSession(monitor, this, "Read procedure body")) {
body = JDBCUtils.queryString(session, "SELECT pg_get_functiondef(" + getObjectId() + ")");
} catch (SQLException e) {
if (!CommonUtils.isEmpty(this.procSrc)) {
log.debug("Error reading procedure body", e);
// At least we have it
body = this.procSrc;
} else {
throw new DBException("Error reading procedure body", e);
}
}
}
}
......
......@@ -20,6 +20,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
......@@ -89,6 +90,7 @@ class SQLGeneratorDialog extends ViewSQLDialog {
Composite composite = super.createDialogArea(parent);
Group settings = UIUtils.createControlGroup(composite, "Settings", 5, GridData.FILL_HORIZONTAL, SWT.DEFAULT);
settings.setLayout(new RowLayout());
Button useFQNames = UIUtils.createCheckbox(settings, "Use fully qualified names", sqlGenerator.isFullyQualifiedNames());
useFQNames.addSelectionListener(new SelectionAdapter() {
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册