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

相关推荐
2501_944521594 天前
Immer 跨端三方库仓颉适配全流程
python·eclipse·django
2501_944521594 天前
Deepmerge 跨端三方库仓颉适配全流程
java·python·eclipse·github
曹牧5 天前
Eclipse:Subclipse
java·ide·eclipse
小码哥(^_^)7 天前
人力资源面试题集1
eclipse·1024程序员节
智购科技自动售卖机厂家9 天前
双摄像头方案F1-score只有0.85,排查发现是上下视角的融合逻辑写反了~YH
python·单片机·嵌入式硬件·算法·eclipse
Baron X15 天前
Eclipse Temurin 21 (JRE) Alpine 镜像获取、离线导入与推送操作
java·docker·eclipse·temurin
开开心心就好17 天前
Windows视频播放器推荐,精简版体积更小
java·服务器·开发语言·eclipse·pdf·ocr·音视频
解道Jdon17 天前
FigCraft把Figma用Rust从零重写了一遍
ide·windows·git·svn·eclipse·github·visual studio
IT小小猪19 天前
# Hadoop 3.3.6 完全分布式集群部署知识库
hadoop·分布式·eclipse
智购科技无人售货机工厂店21 天前
玻璃瓶饮料破损率突然上升,排查发现是取货口缓冲垫老化了~YH
java·开发语言·人工智能·python·eclipse