You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a single driver creation endpoint for all editions of TypeDB (#741)
## Usage and product changes
Introduce a single driver creation endpoint for all editions of TypeDB:
all `new_core`, `new_cloud`, `TypeDB.core`, `TypeDB.cloud`, and other
alternatives in TypeDB drivers now have a single `new` / `driver` method
that accepts a single string as an address.
Use it for any edition of TypeDB 3.x (Community Edition, Cloud,
Enterprise) the following way (check out `README` or driver
documentation for full usage examples):
Rust:
```rust
let driver = TypeDBDriver::new(
TypeDBDriver::DEFAULT_ADDRESS,
Credentials::new("admin", "password"),
DriverOptions::new(false, None).unwrap(),
)
.await
.unwrap();
```
Python:
```py
driver = TypeDB.driver(TypeDB.DEFAULT_ADDRESS, Credentials("admin", "password"), DriverOptions())
```
Java:
```java
Driver driver = TypeDB.driver(TypeDB.DEFAULT_ADDRESS, new Credentials("admin", "password"), new DriverOptions(false, null));
```
Currently, TypeDB 3.x supports only a single server address, so the
list-based method overloading is unnecessary. We plan to preserve the
same simplified API after introducing multi-node servers, extending the
accepted formats of the input address string instead. Stay tuned for
details!
## Implementation
* All excessive driver constructors are removed. Only `new` or `driver`
are left and receive a single string address.
* The Rust and the C drivers still have `new` and `new_with_description`
methods. The latter is used to specify a custom driver language, and
this intent is highlighted in the docs now.
* Similarly, the C driver acquired a dedicated endpoint for constructing
the C driver with the predefined language. It is not exposed in SWIG, so
only `new_with_description` can be used by SWIG-based drivers.
* Renamed `core` -> `community`
* Renamed `cloud` -> `cluster`
* Example tests and examples are unified: now, all editions of TypeDB
use the same set of interfaces. Separate examples specifically for
`cluster`'s features can be written in the future, not affecting these
common files. The package structures are adjusted respectively.
* Updated docs and `README`s.
* Fixed minor test environment bugs.
0 commit comments