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

相关推荐
2601_961194022 天前
2026六级词汇PDF下载|大学英语六级单词表+音频PDF
windows·git·eclipse·pdf·github
2601_961194022 天前
2026六级词汇资料电子版|大学英语六级核心词汇PDF
java·spring·eclipse·pdf·tomcat·hibernate
2601_961194022 天前
2026初级会计实务公式总结大全|计算题公式手册PDF
java·spring·eclipse·pdf·tomcat·hibernate
石山代码4 天前
多语言一站式开发:Eclipse 2025 最新版本安装配置详细教程
eclipse
2601_961194024 天前
考研学校专业课真题
spring boot·考研·eclipse·log4j·scala·symfony
jack@london5 天前
eclipse启动tomcat6时报错OutOfMemoryError: PermGen space
java·ide·eclipse
DIY源码阁7 天前
JavaSwing学生选课系统 - MySQL版
java·数据库·mysql·eclipse
DIY源码阁9 天前
JavaSwing宿舍管理系统 - MySQL版
java·数据库·mysql·eclipse
上弦月-编程9 天前
Java语言核心特点与应用全解析
eclipse
AI行业学习9 天前
CC-Switch 下载、安装与使用配置指南【2026.5.29】
java·开发语言·vscode·python·eclipse·laravel