Skip to content

Commit 1cdc530

Browse files
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

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

.circleci/config.yml

+22-22
Original file line numberDiff line numberDiff line change
@@ -134,22 +134,22 @@ commands:
134134
steps:
135135
- install-pip-requirements
136136
- run: |
137-
tool/test/start-core-server.sh
137+
tool/test/start-community-server.sh
138138
python3.9 -m pip install wheel
139139
python3.9 -m pip install --extra-index-url https://repo.typedb.com/public/public-snapshot/python/simple typedb-driver==0.0.0+$(git rev-parse HEAD)
140140
sleep 5
141141
pushd python/tests/deployment/
142142
python3.9 -m unittest test && export TEST_SUCCESS=0 || export TEST_SUCCESS=1
143143
popd
144-
tool/test/stop-core-server.sh
144+
tool/test/stop-community-server.sh
145145
exit $TEST_SUCCESS
146146
147147
test-pip-snapshot-mac-rosetta:
148148
steps:
149149
- install-brew-rosetta
150150
- run: |
151151
/usr/local/bin/brew install [email protected]
152-
tool/test/start-core-server.sh
152+
tool/test/start-community-server.sh
153153
/usr/local/bin/python3.9 -m pip install wheel
154154
/usr/local/bin/python3.9 -m pip install pip==21.3.1
155155
/usr/local/bin/python3.9 -m pip install -r python/requirements_dev.txt
@@ -158,7 +158,7 @@ commands:
158158
pushd python/tests/deployment/
159159
/usr/local/bin/python3.9 -m unittest test && export TEST_SUCCESS=0 || export TEST_SUCCESS=1
160160
popd
161-
tool/test/stop-core-server.sh
161+
tool/test/stop-community-server.sh
162162
exit $TEST_SUCCESS
163163
164164
deploy-pip-release-unix:
@@ -207,20 +207,20 @@ commands:
207207
test-maven-snapshot-unix:
208208
steps:
209209
- run: |
210-
tool/test/start-core-server.sh
210+
tool/test/start-community-server.sh
211211
sed -i -e "s/DRIVER_JAVA_VERSION_MARKER/0.0.0-$CIRCLE_SHA1/g" java/test/deployment/pom.xml
212212
cat java/test/deployment/pom.xml
213213
(cd java/test/deployment && mvn test)
214-
tool/test/stop-core-server.sh
214+
tool/test/stop-community-server.sh
215215
216216
test-maven-snapshot-mac-rosetta:
217217
steps:
218218
- run: |
219-
tool/test/start-core-server.sh
219+
tool/test/start-community-server.sh
220220
sed -i -e "s/DRIVER_JAVA_VERSION_MARKER/0.0.0-$CIRCLE_SHA1/g" java/test/deployment/pom.xml
221221
cat java/test/deployment/pom.xml
222222
(cd java/test/deployment && /usr/local/bin/mvn test)
223-
tool/test/stop-core-server.sh
223+
tool/test/stop-community-server.sh
224224
225225
deploy-maven-jni-release-unix:
226226
steps:
@@ -262,12 +262,12 @@ commands:
262262
cmake3 ../c/tests/assembly -DTYPEDB_ASSEMBLY=$(pwd)/$ASSEMBLY &&
263263
cmake3 --build . --config release
264264
popd
265-
tool/test/start-core-server.sh
265+
tool/test/start-community-server.sh
266266
sleep 5
267267
pushd test_assembly_clib
268268
LD_LIBRARY_PATH=$ASSEMBLY/lib ./test_assembly && export TEST_SUCCESS=0 || export TEST_SUCCESS=1
269269
popd
270-
tool/test/stop-core-server.sh
270+
tool/test/stop-community-server.sh
271271
exit $TEST_SUCCESS
272272
273273
test-clib-assembly-mac:
@@ -285,12 +285,12 @@ commands:
285285
cmake ../c/tests/assembly -DTYPEDB_ASSEMBLY=$(pwd)/$ASSEMBLY -DCMAKE_OSX_ARCHITECTURES=<<parameters.target-arch>> &&
286286
cmake --build . --config release
287287
popd
288-
tool/test/start-core-server.sh
288+
tool/test/start-community-server.sh
289289
sleep 5
290290
pushd test_assembly_clib
291291
DYLD_LIBRARY_PATH=$ASSEMBLY/lib ./test_assembly && export TEST_SUCCESS=0 || export TEST_SUCCESS=1
292292
popd
293-
tool/test/stop-core-server.sh
293+
tool/test/stop-community-server.sh
294294
exit $TEST_SUCCESS
295295
296296
deploy-clib-release-unix:
@@ -326,12 +326,12 @@ commands:
326326
cmake3 ../cpp/test/assembly -DTYPEDB_ASSEMBLY=$(pwd)/$ASSEMBLY &&
327327
cmake3 --build . --config release
328328
popd
329-
tool/test/start-core-server.sh
329+
tool/test/start-community-server.sh
330330
sleep 5
331331
pushd test_assembly_cpp
332332
LD_LIBRARY_PATH=$ASSEMBLY/lib ./test_assembly && export TEST_SUCCESS=0 || export TEST_SUCCESS=1
333333
popd
334-
tool/test/stop-core-server.sh
334+
tool/test/stop-community-server.sh
335335
exit $TEST_SUCCESS
336336
337337
test-cpp-assembly-mac:
@@ -349,12 +349,12 @@ commands:
349349
cmake ../cpp/test/assembly -DTYPEDB_ASSEMBLY=$(pwd)/$ASSEMBLY -DCMAKE_OSX_ARCHITECTURES=<<parameters.target-arch>> &&
350350
cmake --build . --config release
351351
popd
352-
tool/test/start-core-server.sh
352+
tool/test/start-community-server.sh
353353
sleep 5
354354
pushd test_assembly_cpp
355355
DYLD_LIBRARY_PATH=$ASSEMBLY/lib ./test_assembly && export TEST_SUCCESS=0 || export TEST_SUCCESS=1
356356
popd
357-
tool/test/stop-core-server.sh
357+
tool/test/stop-community-server.sh
358358
exit $TEST_SUCCESS
359359
360360
deploy-cpp-release-unix:
@@ -410,22 +410,22 @@ commands:
410410
test-dotnet-snapshot-unix:
411411
steps:
412412
- run: |
413-
tool/test/start-core-server.sh
413+
tool/test/start-community-server.sh
414414
sleep 5
415415
sed -i -e "s/DRIVER_CSHARP_VERSION_MARKER/0.0.0-$CIRCLE_SHA1/g" csharp/Test/Deployment/NugetApplicationTest.csproj
416416
cat csharp/Test/Deployment/NugetApplicationTest.csproj
417417
(cd csharp/Test/Deployment && dotnet run NugetApplicationTest.csproj)
418-
tool/test/stop-core-server.sh
418+
tool/test/stop-community-server.sh
419419
420420
test-dotnet-snapshot-mac-rosetta:
421421
steps:
422422
- run: |
423-
tool/test/start-core-server.sh
423+
tool/test/start-community-server.sh
424424
sleep 5
425425
sed -i -e "s/DRIVER_CSHARP_VERSION_MARKER/0.0.0-$CIRCLE_SHA1/g" csharp/Test/Deployment/NugetApplicationTest.csproj
426426
cat csharp/Test/Deployment/NugetApplicationTest.csproj
427427
(cd csharp/Test/Deployment && /usr/local/bin/dotnet run NugetApplicationTest.csproj)
428-
tool/test/stop-core-server.sh
428+
tool/test/stop-community-server.sh
429429
430430
deploy-dotnet-runtime-release-unix:
431431
steps:
@@ -478,13 +478,13 @@ commands:
478478
test-npm-snapshot-unix:
479479
steps:
480480
- run: |
481-
tool/test/start-core-server.sh
481+
tool/test/start-community-server.sh
482482
cd nodejs/test/deployment/
483483
npm install --registry https://npm.cloudsmith.io/typedb/public-snapshot/ "[email protected]$CIRCLE_SHA1"
484484
npm install jest --global
485485
jest --detectOpenHandles application.test.js && export TEST_SUCCESS=0 || export TEST_SUCCESS=1
486486
cd -
487-
tool/test/stop-core-server.sh
487+
tool/test/stop-community-server.sh
488488
exit $TEST_SUCCESS
489489
490490
deploy-npm-release-unix:

0 commit comments

Comments
 (0)