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

相关推荐
shjita6 天前
几个hadoop中运行mapreduce的错误记录一下。
大数据·hadoop·eclipse
不正经的码狗10 天前
Java 开发环境搭建与 Eclipse 使用速通教程
java·开发语言·eclipse
智购科技自动售货机工厂11 天前
数字人民币硬钱包支付失败,排查发现是NFC读卡器功率不足~YH
python·面试·架构·eclipse·emacs
不正经的码狗19 天前
JAVA 、Eclipse 安装及配置 JAVA 项目(无需配置环境)
java·eclipse
不正经的码狗19 天前
Eclipse汉化(快速,推荐)
java·eclipse
vx_BS8133021 天前
【项目编号:project51629】Spring Boot 乡村自来水缴费系统:把抄表、水费生成与在线缴费做成一条数字化闭环
java·spring boot·eclipse·tomcat·maven
暮雨哀尘21 天前
JAVA基础练习(四):SpringBoot 实现简易登录功能
java·spring boot·eclipse·maven
智购科技自动售卖机厂家22 天前
设备一到夏天就频繁跳闸,从启动电流追到压缩机电容~YH
数据结构·人工智能·python·eclipse
vx_BS8133022 天前
【项目编号:project51381】Spring Boot 婚纱摄影管理系统:套餐预约、在线咨询、支付与客片展示的一站式业务实现
java·spring boot·eclipse·tomcat·mybatis
解道Jdon24 天前
JDK 27发布:紧凑对象头、G1默认、量子安全TLS
ide·windows·git·svn·eclipse·github·visual studio