Dbeaver 搜索自动加引号

搜索输入 1 自动加上引号 修改 Dbeaver源码

找到源码包 plugins org.jkiss.dbeaver.ui.editors.data

ResultSetFilterPanel 文件

加上

java 复制代码
    private static final Pattern SIMPLE_EQUALS_FILTER_PATTERN = Pattern.compile("^(\\s*.+?\\s*=\\s*)(\\S+)(\\s*)$");

    @NotNull
    private String autoQuoteFilterCondition(@NotNull DBCExecutionContext context, @NotNull String condition) {
        Matcher matcher = SIMPLE_EQUALS_FILTER_PATTERN.matcher(condition);
        if (!matcher.matches()) {
            return condition;
        }

        String leftPart = matcher.group(1).trim();
        if (leftPart.endsWith(">") || leftPart.endsWith("<") || leftPart.endsWith("!")) {
            return condition;
        }

        String value = matcher.group(2);
        if (value.startsWith("'") || value.startsWith("\"") || value.startsWith(":") || value.startsWith("?")) {
            return condition;
        }
        if (value.indexOf('(') >= 0 || value.indexOf(')') >= 0) {
            return condition;
        }
        if (SQLConstants.KEYWORD_NULL.equalsIgnoreCase(value) || "true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value)) {
            return condition;
        }

        return matcher.group(1) + context.getDataSource().getSQLDialect().getQuotedString(value) + matcher.group(3);
    }

在 setCustomDataFilter 方法里面调用

String condition = autoQuoteFilterCondition(context, filtersText.getText());

简单编译 Dbeaver源码

下载特定eclipse版本 https://archive.eclipse.org/technology/epp/downloads/release/2025-03/R/eclipse-committers-2025-03-R-win32-x86_64.zip

导入项目 必须用:Projects from Folder or Archive

配置Target Platform 导入 自身项目文件夹作为新的 target 并把 eclipse_home 的一并加入

注意我编译好的jar文件版本是 DBeaver 23.3.2

相关推荐
DIY源码阁13 天前
JavaSwing饮品管理系统 - MySQL版
java·数据库·mysql·eclipse
2601_9618752413 天前
花生十三公考课程|网课|视频
数据库·windows·git·svn·eclipse·github
2601_9618752413 天前
花生十三资料网盘|百度云|下载
数据库·windows·git·svn·eclipse·github
2601_9618752414 天前
法考备考计划表|学习计划|资料已整理
java·开发语言·学习·eclipse·tomcat·c#·hibernate
2601_9618752416 天前
法考资料2026|全套|资料已整理
数据结构·算法·链表·贪心算法·eclipse·线性回归·动态规划
DIY源码阁17 天前
JavaSwing酒店管理系统 - MySQL版
java·mysql·eclipse
AI行业学习18 天前
CC-Switch v3.16.1 官方下载 | 安装配置详细教程【2026.6.10】
java·开发语言·vue.js·python·mysql·eclipse·html
2601_9618454219 天前
2026四级作文预测26年|英语四级写作范文+模板PDF
java·数据库·spring·eclipse·pdf·tomcat·hibernate
2601_9611940220 天前
考研资料电子版|下载|pdf
java·python·考研·eclipse·django·pdf·pygame
2601_9611940223 天前
2026六级词汇PDF下载|大学英语六级单词表+音频PDF
windows·git·eclipse·pdf·github