alibaba / alibaba/neug

[Cypher] Add DB_VERSION() with engine and checkpoint data compatibility versions

Open
#960 1 comment 0 reactions 1 assignee Claimed by @shirly121 View on GitHub
compiler executor store
Dominant language
C++
Stars
157
Forks
32
Avg merge
1d 11h
Merged PRs (30d)
99

Description

## Motivation

Clients need a Cypher-level way to identify both the running NeuG engine and the checkpoint data format supported by that engine before switching or opening database directories.

Add:

```cypher
CALL DB_VERSION() RETURN *;
```

NeuG releases guarantee forward compatibility with supported older checkpoint data, but do not guarantee that an older release can open data written by a newer release.

## Reproduction of the current behavior

```python
from neug import Database

db = Database(db_path="./db_version_repro", mode="w")
conn = db.connect()
result = conn.execute("CALL DB_VERSION() RETURN *;")
print(result)
```

Observed: the function does not exist and fails with a catalog error.

## Proposed result

Return at least:

- `engine_version`: the running NeuG release/build version.
- `max_data_version`: the newest checkpoint data version supported by the running release.

The compatibility rule should be explicit:

```text
data_version <= max_data_version => supported
data_version > max_data_version => reject with a clear incompatibility error
```

## Acceptance criteria

- `CALL DB_VERSION() RETURN *;` works in embedded and service modes.
- The result contains the engine version and maximum supported data version.
- Opening a checkpoint newer than `max_data_version` fails early with an actionable error that includes both versions.
- Tests cover a new database, an older compatible checkpoint, and a newer unsupported checkpoint.
- The compatibility semantics and column definitions are documented.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.