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

相关推荐
曹牧2 天前
Java:将 IntelliJ IDEA 项目迁移至 Eclipse
java·eclipse·intellij-idea
2601_963932985 天前
人流手术多少天做比较适合?最佳手术周期与术后修护科普指南
eclipse
HillVue5 天前
Token 叙事退潮,DAA 重新定义 AI 价值标准
java·人工智能·eclipse
qiuyi105 天前
CRM产品对比测评:励拓云CRM vs 励销云CRM,名字相近但定位迥异
人工智能·eclipse·制造·tornado
石像鬼₧魂石8 天前
贵州商会管理系统 —— 商协会数字化运营一站式平台
大数据·数据结构·物联网·eclipse·数据库架构
zhangjin112010 天前
Tomcat下载安装配置-eclipse版
eclipse·tomcat·firefox
渡我白衣10 天前
打印宏与socket模块设计
java·linux·开发语言·c++·ide·人工智能·eclipse
Xiangchu_12 天前
合肥新能源汽车崛起,本地硅胶件谁来供
python·算法·eclipse·sqlite·汽车·制造
Xiangchu_12 天前
安徽硅胶厂的转型困局:从家电到汽车,卡在哪
经验分享·python·阿里云·eclipse·汽车·制造
曹牧14 天前
Eclipse:SVN 回复
java·svn·eclipse