type_bridge.typedb_driver¶
typedb_driver
¶
TypeDB driver compatibility helpers.
This module re-exports the TypeDB driver components so users can import everything from type_bridge instead of mixing imports from typedb.driver.
Example
from type_bridge import Database, Credentials, TypeDB
Instead of:¶
from typedb.driver import Credentials, TypeDB¶
from type_bridge import Database¶
TransactionType
¶
Bases: Enum
Rust-safe fallback transaction type for the default backend.
raise_missing_typedb_driver
¶
create_driver_options
¶
Create TypeDB driver options for the retained driver lines.
The same band map that drives the version gate drives option construction.
Supported 3.11 and 3.12 drivers both use the positional
DriverOptions(tls_config) form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_tls_enabled
|
bool
|
Whether to enable TLS for the driver connection. |
False
|
tls_root_ca
|
str | PathLike[str] | None
|
Optional PEM root-CA path for an enabled TLS connection. |
None
|
Returns:
| Type | Description |
|---|---|
DriverOptions
|
Configured |
Raises:
| Type | Description |
|---|---|
UnsupportedVersionError
|
When the installed driver version is outside the supported range (no known band). |
ValueError
|
When a root path is supplied while TLS is disabled or the root path is empty. |
Source code in type_bridge/typedb_driver.py
driver_version
¶
Return the installed typedb-driver package version.
This is the one version fact Python computes itself: a Python-runtime
metadata query that Rust cannot observe. The result matches whatever
typedb-driver release is installed in the current environment.
Source code in type_bridge/typedb_driver.py
embedded_driver_version
¶
Return the typedb-driver version compiled into the Rust runtime.
Every ORM transaction executes through the embedded Rust drivers; their
accepted-band set is gated independently of the optional installed Python
driver. The latter is consulted only for direct typedb.driver access.
Delegates to type_bridge_core.embedded_driver_version.
Returns the band-8 (3.11.x) pin for back-compat. Use
:func:embedded_driver_versions to get all compiled-in bands.
Source code in type_bridge/typedb_driver.py
embedded_driver_versions
¶
Return all driver versions compiled into the Rust runtime, keyed by band.
Delegates to type_bridge_core.embedded_driver_versions. The default
build returns {8: "3.11.5", 9: "3.12.3"}; a
single-band build returns only the one entry for its compiled band.
Source code in type_bridge/typedb_driver.py
server_version
¶
Return the TypeDB server version by probing its HTTP API.
Delegates entirely to type_bridge_core.server_version; no HTTP code
lives here. address follows the connect-address form "host:1729";
the core layer derives the HTTP host from it and handles TLS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Connect address in |
required |
http_port
|
int
|
HTTP API port (default 8000). |
DEFAULT_HTTP_PORT
|
tls
|
bool
|
Whether to use HTTPS for the version probe. |
False
|
tls_root_ca
|
str | PathLike[str] | None
|
Optional PEM root-CA path for an explicitly enabled HTTPS probe. The root path does not enable TLS implicitly. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Version string reported by the server (e.g. |
Raises:
| Type | Description |
|---|---|
VersionError
|
When the endpoint is unreachable or the response cannot be parsed. |
ValueError
|
When custom-root TLS configuration is contradictory or invalid. |