Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Implement Java-backed DBM support for dbmopen and dbmclose

已关闭
#1,494 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
java, perl, sqlite
领域
backend, databases

调研方向

The issue requires implementing dbmopen and dbmclose operators in CoreOperatorResolver, using SQLite JDBC as the storage backend. Start by examining the existing parser and operator resolver in the PerlOnJava codebase, then create a Java module (likely PerlOnJava::DBM) to handle tied-hash operations. Write unit tests in src/test/resources/unit to verify DBM behavior, and ensure compatibility with JVM and interpreter backends. The work is done when the relevant perl5_t DBM tests pass without modifying upstream tests.

由索引模型根据 Issue 内容生成。

描述

area:backend area:runtime enhancement

Summary

Implement Java-backed DBM support for PerlOnJava so portable Perl programs can
use dbmopen and dbmclose without XS modules such as DB_File, SDBM_File,
NDBM_File, or GDBM_File.

The current parser recognizes the operators and their Perl prototypes, but
CoreOperatorResolver deliberately throws Not implemented: operator: dbmopen
and dbmclose. AnyDBM_File therefore cannot select a usable backend under
PerlOnJava.

Motivation and evidence

The Perl core tests perl5_t/t/op/dbm.t and the DBM portions of
perl5_t/t/op/coreamp.t currently cannot run:

Not implemented: operator: dbmopen at op/dbm.t line 67, near "(%truffe"

The upstream tests exercise observable tied-hash behavior, but the standard
Perl implementations are native XS modules. PerlOnJava should provide a
portable Java implementation for the common DBM contract rather than attempt
to load those native modules.

Proposed first implementation

Use the already bundled SQLite JDBC dependency as the storage engine. Store
byte-string keys and values in a table keyed by the DBM filename, with a
schema equivalent to:

CREATE TABLE entries (
    key BLOB PRIMARY KEY,
    value BLOB NOT NULL
)

Expose the backend through a PerlOnJava Java module, likely a
PerlOnJava::DBM implementation registered through XSLoader, and provide a
minimal Perl-side SDBM_File/AnyDBM_File compatibility layer as needed.

The first format need not read or write legacy Berkeley DB, SDBM, NDBM, or GDBM
files. It should document that the initial backend is PerlOnJava-native. A
future compatibility layer can be considered separately.

Required behavior

Implement and test:

  • dbmopen(%hash, $filename, $mode);
  • dbmclose(%hash);
  • tied-hash FETCH, STORE, DELETE, CLEAR, and EXISTS;
  • FIRSTKEY/NEXTKEY iteration with stable behavior during a scan;
  • read-only versus writable open modes;
  • creation and reopening of persistent databases;
  • empty values, binary keys, and binary values;
  • missing-file and invalid-mode diagnostics;
  • close/untie cleanup and transaction commit behavior;
  • file locking or an explicit documented concurrency boundary;
  • consistent behavior on JVM and interpreter backends;
  • useful $!/Perl exception behavior for filesystem and SQLite failures.

Compatibility boundaries

The first version should not claim compatibility with existing native DBM file
formats. It should also avoid silently pretending that DB_File, GDBM_File,
NDBM_File, ODBM_File, or SDBM_File XS APIs are available. Existing
XSLoader unsupported-module handling must remain explicit and predictable.

coreamp.t contains unrelated given/when coverage, so DBM work alone will
not make that entire core test pass. The DBM-specific assertions should be
covered independently.

Testing and acceptance criteria

  • Add project-owned unit tests under src/test/resources/unit for the complete
    supported DBM behavior.
  • Validate each Perl-level test with system Perl where the behavior has a
    standard-Perl representation.
  • Require JVM and interpreter backend success.
  • Add persistence, iteration, binary-data, read-only, cleanup, and error-path
    coverage.
  • Run the relevant perl5_t DBM tests when the implementation is complete,
    without modifying upstream tests.
  • Update compatibility documentation and the unsupported-feature notes to
    state the supported backend and file-format boundary.
  • Keep the implementation independent of platform-specific native DBM
    libraries.
主要语言
Perl
星标
64
派生
7
平均合并
5 小时 6 分钟
30 天内合并 PR
200

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。