Commit 1cdc530
authored
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.1 parent 1e0992f commit 1cdc530
File tree
111 files changed
+786
-4095
lines changed- .circleci
- .factory
- c
- src
- dependencies/typedb
- docs/modules/ROOT/partials
- java/connection
- python/connection
- rust
- connection
- errors
- transaction
- java
- api
- database
- user
- concept
- answer
- connection
- test
- behaviour
- connection
- database
- transaction
- debug
- driver
- driver
- user
- deployment/src/test/java/application
- integration
- cloud
- cluster
- core
- user
- python
- tests
- behaviour
- background
- cluster
- community
- connection
- user
- deployment
- integration
- cluster
- core
- typedb
- api/user
- connection
- rust
- src
- common
- connection
- database
- tests
- behaviour
- config
- connection
- driver
- steps
- connection
- integration
- cloud
- cluster
- core
- tool
- docs
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
111 files changed
+786
-4095
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
| 357 | + | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
| 481 | + | |
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
487 | | - | |
| 487 | + | |
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| |||
0 commit comments