Repository navigation
Releases
dNHyDB 0.3.0
Compatibility
These changes can require changes in existing code:
- Python 3.12–3.15. Support for Python 3.9, 3.10 and 3.11 ends
(previously 3.9–3.14); thetomlidependency is gone. Nonein a BASE field raisesValueErrorfor every type (R9E-01).
Previouslyutf8silently stored the text"None"andboolstored
False. Store a null withput_cell(u, v, None), remove a value with
delete_cell.delete_celldeletes only a live cell (a storedNoneincluded). For
an already deleted or never written cell it returnsFalseand writes
nothing (R9A-04). Previously a deleted BASE field returnedTrueagain,
and every call on a deleted cell wrote another tombstone.- Iterators after
rollback(): openrecords,cellsandscan
iterators end withDnhydbError("iterator invalidated") instead of
returning buffered values of the discarded state (I7). repair_file()no longer cuts intact committed blocks or keeps
uncommitted blocks silently; such a repair raisesCorruptionErrorunless
allow_data_loss=Trueorkeep_uncommitted=Trueis given (details under
Changed).- Rust:
Db::has_recordreturnsResult<bool>; new error variants
Error::MemoryandError::IoPath.
Changed
- macOS, durability
fsync: the data of a commit is now synchronized with
F_BARRIERFSYNC(anfsyncplus an I/O barrier) before the superblock is
written, so the drive persists the data before the superblock. This
guarantees the write order, not the persistence of the latest commits
(the drive cache is not flushed; onlyfullrequests that). Where the
file system does not support the barrier, dNHyDB falls back to plain
fsyncwithout this ordering guarantee. Single commits get slower: on an
Apple M1 Max a commit with data takes about 1 ms instead of roughly
0.06 ms; batch commits are barely affected. Commit less often if
throughput matters.full,none, Linux and Windows are unchanged. repair_file()(anddnhydb repair) no longer discards intact committed
blocks or keeps uncommitted blocks silently. New options
allow_data_loss=Falseandkeep_uncommitted=False(CLI
--allow-data-loss,--keep-uncommitted; RustRepairOptionswith
Db::repair_file_opts). Without them, a repair that would lose data
raisesCorruptionErrorand changes nothing. The dry run reports the
plannedaction; the report has new keys (superblocks,
superblock_problem,uncommitted_bytes,missing_committed_bytes,
damaged_blocks,later_valid_blocks,safe_end,cut_reason,
lost_blocks,discarded_uncommitted_blocks,kept_uncommitted_blocks).inspect_tail()also checks both superblocks;cleanisfalseif a
superblock is damaged or the commit boundary is beyond the end of the
file or not on a block boundary.verify()reports every damaged block; a stale VALUE index is reported
under the new keyswarnings/warning_countand no longer makesok
false (health()then reportswarninginstead ofunhealthy).- A commit without new blocks writes nothing; opening, reading and closing
leaves the file unchanged. - After a failed data or superblock sync during a commit, the handle is
unusable: write methods,commit,rollback,flush,beginand
checkpointraiseDnhydbError;close()releases handle and lock. - Paths are anchored as absolute paths when opening (
path,
stats()["file"]andcompact()["file"]are absolute). - A directory as database path raises
IsADirectoryError(also for
createwithoutoverwrite); OS errors carryerrno,strerrorand
filenameand use the matchingOSErrorsubclass. - Command line: defined exit codes (0 ok, 1 problems found, 2 error without
traceback);tailandrepairwithout--applyexit with 1 on a file
that is not clean;verifyreports the tail inspection if a damaged file
cannot be opened. - VALUE index: NaN never matches (equality or range), as in a scan.
- A buffered (uncommitted) cell reads with the same normalised value as
after the commit. read_numpy(..., masks=True)adds"_cells": per field a bool array that
isTruewhere the cell lives (R9E-02). Withoutmasksthe output is
unchanged.compact(output=...)locks the target for the whole run and never
replaces a file that appeared in the meantime (RD4-08).
Fixed
- Data blocks found by the scan (without or beyond the catalog) and
SECONDARY index blocks are CRC-checked before first use; damaged block
prefixes no longer lead to silently wrong or missing values but to
CorruptionError. - Opening as writer no longer truncates complete blocks behind the commit
boundary when the other superblock is damaged; it fails with
CorruptionError(readers read the older state). create(overwrite=True)replaces the old file atomically; on failure the
old database stays intact.close()after own commits also writes the second superblock slot.- Repair writes new superblocks with rising generations before cutting the
file, takes the write lock before inspecting it, and creates unique,
synchronized backups (never overwritten within the same second); files
that are too short or not a database are rejected unchanged. - Failed batch writes (
put_cells,put_records, NumPy batches) leave no
blocks behind. - Windows: replacing a file that is briefly in use is retried.
- The lock file is never opened through a symbolic link; a directory or an
empty path is rejected before the lock file is created, and a lock file
created by a failedcreateis removed. - After
close(), every method and iterator raisesDnhydbError
(includinghas_record,schema,verify,health, setters);
withon a closed database raisesDnhydbError, and a failed commit on
leaving awithblock still releases handle and lock. - Huge
countvalues inread_numpyand allocation failures (bytes(n),
index build) raiseMemoryErrorinstead of aborting the process. - Deeply nested or cyclic values raise
ValueError, deeply nested
metadata JSON raisesCorruptionError(no stack overflow); values and
groups of cells larger than 4 GiB are rejected withValueError;
decompression of posting lists is bounded. - NumPy columns of unsupported types (
float16,longdouble) raise
TypeErrorinstead of recursing. - Missing required keys in the schema JSON raise
CorruptionErrorinstead
ofKeyError. - A side with only free cells is no longer reported as stale after
build_indexes(). - A block at a foreign position (copied or swapped, CRC valid) no longer
returns old values: block ids must grow with the file position, and
blocks known from the catalog are checked against their header; open,
reads andverify()reportCorruptionError(RD-01, RD-05). - Two blocks with the same id no longer crash
verify(), compaction or
point listings; they raiseCorruptionError. get_cellreturns a value written withput_cellfor a BASE field that
the record's stored shape did not have yet (it returnedNone).- Concurrent use of one handle from several threads raises
RuntimeError
instead ofPanicExceptionin every method and iterator (R9D-01). - A failed
define_baseleaves no metadata blocks that a later commit would
make durable. - A failed compaction no longer leaves
<db>.compactingbehind; a leftover
is replaced under the lock (RD4-03). - A failed commit inside
checkpoint()no longer leaves a checkpoint offset
that points at a discarded block.
dNHyDB 0.2.0
dNHyDB v0.2.0 — Mathematical Database Addressing, Now Cross-Platform
dNHyDB brings Dynadron-based mathematical cell addressing to a native Rust database engine, accessible directly from Python.
Instead of treating database addresses as merely arbitrary storage positions, dNHyDB uses a mathematically structured coordinate system derived from the Dynadron of natural numbers.
Version 0.2.0 is a major portability milestone: the engine now runs on Linux, macOS and Windows, with prebuilt Python wheels across five platform targets and six CPython versions.
One mathematical addressing principle. One native database engine. Five platform targets.
Installation
pip install dnhydbNo Rust compiler is required when installing a supported prebuilt wheel. PyPI availability follows the separately approved publishing step.
Platform Support
Operating system | Architecture | Python -- | -- | -- Linux (manylinux_2_28) | x86_64 | 3.9–3.14 Linux (manylinux_2_28) | aarch64 | 3.9–3.14 macOS | Intel x86_64 | 3.9–3.14 macOS | Apple Silicon arm64 | 3.9–3.14 Windows | x64 | 3.9–3.1430 prebuilt wheels + 1 source distribution.
All 30 wheel installation-test jobs passed in the release pipeline, including tests on the target operating systems and Python versions.
What's New in v0.2.0
Cross-platform native storage engine
The previously Unix-specific storage implementation has been made portable across Linux, macOS and Windows.
The platform layer now provides:
Positional file I/O across supported operating systems.
Exclusive writer locking using Rust's
File::try_lock.Platform-specific synchronization, including
FlushFileBufferson Windows.File identity detection, including volume and file identifiers on Windows, to recognize replaced database files.
Portable local-time handling for backup filenames.
Improved database lifecycle
close() now releases the underlying file handle and write lock immediately.
Further behavior is explicitly defined:
Access after closing raises
DnhydbError(database is closed).Repeated calls to
close()are harmless.If
close(commit=True)cannot commit, the database remains open so the operation can be retried or discarded.close(commit=False)releases the handle and lock even if buffered writing fails.
Python compatibility improvements
load_options() now supports Python 3.9 and 3.10 through the automatically installed tomli backport. Newer Python versions use their built-in TOML support.
More reliable testing and distribution
The Python test suite no longer depends on a Rust target/ directory already existing.
Tests now run correctly from fresh source checkouts and source distributions.
The release pipeline builds and verifies the complete package set, then independently installs and tests each of the 30 supported wheel combinations.
Mathematical Foundation — Unchanged
The cross-platform work does not alter the fundamental database architecture:
Dynadron-based mathematical cell addressing remains unchanged.
The existing
NHYDB014database file format remains unchanged.The Rust database core continues to expose its functionality through Python/PyO3.
This release expands where dNHyDB can run without changing the mathematical principle on which it is built.
Project Status
dNHyDB is an experimental, source-available database technology under active development.
Version 0.2.0 is published as a pre-release. The project documentation describes the supported functionality, current limitations and applicable license terms.
dNHyDB v0.2.0 — From a mathematical addressing concept to a tested cross-platform database engine.
dNHyDB v0.1.0 – Initial Public Release
dNHyDB v0.1.0 — Initial Public Release
This is the first public release of dNHyDB, a lightweight database engine based on the mathematical addressing principles of the Dynadron.
Key Features
- Native Rust database engine with Python bindings (PyO3).
- Direct mathematical addressing of storage cells using Dynadron coordinates.
- Exact bidirectional conversion between natural-number cell references and structural Dynadron addresses.
- CLASSIC record layout within the first Realm.
- Persistent storage, record operations, and secondary indexing.
- Technical documentation in German and English.
Validation and Benchmarks
The release has been validated through 64 Rust tests and 14 Python tests.
Comparative benchmarks involving 10 million numerical records demonstrate high write throughput and compact index structures.
Scientific Background
The mathematical database principle is described in:
Das Dynadron als mathematisches Datenbankprinzip
https://doi.org/10.5281/zenodo.23438748
License
Source-available software. Usage is governed by the included LICENSE.md, which restricts use to non-production purposes.
Release Status
Initial public release — Version 0.1.0 (Alpha).