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

相关推荐
伯远医学3 天前
Nat. Methods | 邻近标记技术:活细胞中捕捉分子互作的新利器
java·开发语言·前端·javascript·人工智能·算法·eclipse
曦月合一3 天前
禁用eclipse项目中的加载验证,使项目在eclipse中快速加载完成
eclipse
JAVA面经实录9175 天前
Java初级最终完整版学习路线图
java·spring·eclipse·maven
知识领航员8 天前
2026年推荐6个AI音乐工具
java·人工智能·python·eclipse·django·php·pygame
随读手机11 天前
多式联运信息交互平台完整方案(2026版)
java·ai·eclipse·云计算·区块链
FYKJ_201013 天前
springboot校园兼职平台--附源码02041
java·javascript·spring boot·python·eclipse·django·php
kybs199113 天前
springboot视频推荐系统--附源码72953
java·spring boot·python·eclipse·asp.net·php·idea
AC赳赳老秦13 天前
财务报销自动化:用 OpenClaw 自动识别发票信息、填写报销单、校验报销规则,减少手工操作
运维·网络·eclipse·github·visual studio·deepseek·openclaw
AC赳赳老秦14 天前
投标合规提效:用 OpenClaw 实现标书 / 合同自动审核、关键词校验、格式优化,降低废标风险
开发语言·前端·python·eclipse·emacs·deepseek·openclaw