type_bridge.version¶
version
¶
TypeDB version gate shim.
Re-exports the window/band surface from type_bridge_core (SSOT in
crates/core/src/version.rs) and defines UnsupportedVersionError as the
documented TypeBridge exception type.
No window literals, no comparison logic, and no band numbers live here — all decisions are delegated to core.
UnsupportedVersionError
¶
Bases: VersionError
Raised when the driver/server pair falls outside the support window or spans incompatible protocol bands.
The exception message contains both detected version strings and a
human-readable remediation hint (e.g. which typedb-driver version to
install) so callers never need to parse protocol numbers.
This is a subclass of type_bridge_core.VersionError, so existing
except type_bridge_core.VersionError catches work unchanged while
callers that import only type_bridge can target this type directly.
ensure_supported
¶
Assert that a driver/server version pair is within the support window and band.
Translates type_bridge_core.VersionError into
:class:UnsupportedVersionError so all version-gate failures surface as the
documented TypeBridge exception type. Contains no comparison logic — the
decision is entirely core's.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
str
|
Installed driver version string (e.g. |
required |
server
|
str
|
Detected server version string (e.g. |
required |
Raises:
| Type | Description |
|---|---|
UnsupportedVersionError
|
When the pair violates the window or crosses protocol bands. The message names both versions and a remediation hint. |
Source code in type_bridge/version.py
ensure_runtime_supported
¶
Assert the embedded Rust runtime can serve the detected server.
Every TypeBridge transaction executes through the Rust runtime's own
typedb-driver, and the default build embeds drivers covering the full
supported window (3.8–3.12; confirmed 3.12 servers normally negotiate
embedded band 9, with band 8 retained for discovery/fallback). Core makes
the decision using band-set intersection —
the band set is derived from the compiled features in the Rust runtime
(check_server_supported reads them directly), so any in-window server
is accepted by the default build. This wrapper only reframes the failure
— the "install a different typedb-driver" remediation does not apply to a
driver compiled into the wheel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
str
|
Detected server version string. |
required |
Raises:
| Type | Description |
|---|---|
UnsupportedVersionError
|
When the server is outside the supported window or (in a non-default single-band build) its band is not compiled in. The message names the supported window and gives wheel-appropriate remediation. |