diff --git a/.circleci/config.yml b/.circleci/config.yml
index f28e253a8e..7a99a0c0d8 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -831,32 +831,32 @@ workflows:
- deploy-snapshot-linux-arm64:
filters:
branches:
- only: [development, master, "3.0"]
+ only: [development, master]
- deploy-snapshot-linux-x86_64:
filters:
branches:
- only: [development, master, "3.0"]
+ only: [development, master]
- deploy-snapshot-mac-arm64:
filters:
branches:
- only: [development, master, "3.0"]
+ only: [development, master]
- deploy-snapshot-mac-x86_64:
filters:
branches:
- only: [development, master, "3.0"]
+ only: [development, master]
- deploy-snapshot-windows-x86_64:
filters:
branches:
- only: [development, master, "3.0"]
+ only: [development, master]
- deploy-snapshot-any:
filters:
branches:
- only: [development, master, "3.0"]
+ only: [development, master]
requires:
- deploy-snapshot-linux-arm64
- deploy-snapshot-linux-x86_64
@@ -878,7 +878,7 @@ workflows:
- test-snapshot-linux-arm64:
filters:
branches:
- only: [master, "3.0"]
+ only: [master]
requires:
- deploy-snapshot-linux-arm64
- deploy-snapshot-any
@@ -887,7 +887,7 @@ workflows:
- test-snapshot-linux-x86_64:
filters:
branches:
- only: [master, "3.0"]
+ only: [master]
requires:
- deploy-snapshot-linux-x86_64
- deploy-snapshot-any
@@ -896,7 +896,7 @@ workflows:
- test-snapshot-mac-arm64:
filters:
branches:
- only: [master, "3.0"]
+ only: [master]
requires:
- deploy-snapshot-mac-arm64
- deploy-snapshot-any
@@ -905,27 +905,26 @@ workflows:
- test-snapshot-mac-x86_64:
filters:
branches:
- only: [master, "3.0"]
+ only: [master]
requires:
- deploy-snapshot-mac-x86_64
- deploy-snapshot-any
# - deploy-snapshot-dotnet-any
-# TODO: Windows typedb artifact is not ready
-# - test-snapshot-windows-x86_64:
-# filters:
-# branches:
-# only: [master, "3.0"]
-# requires:
-# - deploy-snapshot-windows-x86_64
-# - deploy-snapshot-any
+ - test-snapshot-windows-x86_64:
+ filters:
+ branches:
+ only: [master]
+ requires:
+ - deploy-snapshot-windows-x86_64
+ - deploy-snapshot-any
# - deploy-snapshot-dotnet-any
# TODO: npm is not ready
# - test-snapshot-any:
# filters:
# branches:
-# only: [master, "3.0"]
+# only: [master]
# requires:
# - deploy-snapshot-any
diff --git a/.factory/automation.yml b/.factory/automation.yml
index 06d2bc6bea..497d93926e 100644
--- a/.factory/automation.yml
+++ b/.factory/automation.yml
@@ -87,8 +87,8 @@ build:
tool/docs/update_readme.sh
git add .
- git diff --exit-code || {
- echo "Failed to verify README files: plese update it manually and verify the changes"
+ git diff --exit-code || {
+ echo "Failed to verify README files: please update it manually and verify the changes"
exit 1
}
@@ -111,7 +111,7 @@ build:
if [[ -n "$COMMUNITY_FAILED" ]]; then exit 1; fi
# TODO: Use cluster server artifact with 3 nodes for the same common tests when available
- # tool/test/start-cluster-servers.sh 3 &&
+ # source tool/test/start-cluster-servers.sh 3 &&
# bazel test //rust/tests/integration:all --test_output=streamed --test_arg=--nocapture &&
# export CLUSTER_FAILED= || export CLUSTER_FAILED=1
# tool/test/stop-cluster-servers.sh
@@ -133,22 +133,22 @@ build:
tool/test/stop-community-server.sh
exit $TEST_SUCCESS
- # TODO: Use cluster server artifact with 3 nodes when available (it would do the same thing as community now)
- # test-rust-behaviour-cluster:
- # image: typedb-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
- # dependencies:
- # - build
- # command: |
- # export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
- # export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
- # bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
- # bazel run @typedb_dependencies//distribution/artifact:create-netrc
- #
- # tool/test/start-cluster-servers.sh 3 &&
- # bazel test //rust/tests/behaviour/... --//rust/tests/behaviour/config:mode=cluster --test_output=streamed --jobs=1 &&
- # export TEST_SUCCESS=0 || export TEST_SUCCESS=1
- # tool/test/stop-cluster-servers.sh
- # exit $TEST_SUCCESS
+ # TODO: Use cluster server artifact with 3 nodes when available (it currently uses 1)
+ test-rust-behaviour-cluster:
+ image: typedb-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
+ dependencies:
+ - build
+ command: |
+ export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
+ export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
+ bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
+ bazel run @typedb_dependencies//distribution/artifact:create-netrc
+
+ source tool/test/start-cluster-servers.sh 1 &&
+ bazel test //rust/tests/behaviour/... --test_env=ROOT_CA=$ROOT_CA --//rust/tests/behaviour/config:mode=cluster --test_output=streamed --jobs=1 &&
+ export TEST_SUCCESS=0 || export TEST_SUCCESS=1
+ tool/test/stop-cluster-servers.sh
+ exit $TEST_SUCCESS
# test-c-integration:
# image: typedb-ubuntu-20.04 # Ubuntu 20.04 has GLIBC version 2.31 (2020) which we should verify to compile against
@@ -182,7 +182,7 @@ build:
if [[ -n "$COMMUNITY_FAILED" ]]; then exit 1; fi
# TODO: Use cluster server artifact with 3 nodes for the same common tests when available
- # tool/test/start-cluster-servers.sh 3 &&
+ # source tool/test/start-cluster-servers.sh 3 &&
# bazel test //java/test/integration:all --test_output=streamed --jobs=1 &&
# export CLUSTER_FAILED= || export CLUSTER_FAILED=1
# tool/test/stop-cluster-servers.sh
@@ -204,22 +204,22 @@ build:
tool/test/stop-community-server.sh
exit $TEST_SUCCESS
- # TODO: Use cluster server artifact with 3 nodes when available (it would do the same thing as community now)
- # test-java-behaviour-cluster:
- # image: typedb-ubuntu-22.04
- # dependencies:
- # - build
- # command: |
- # export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
- # export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
- # bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
- # bazel run @typedb_dependencies//distribution/artifact:create-netrc
- #
- # tool/test/start-cluster-servers.sh 3 &&
- # .factory/test-cluster.sh //java/test/behaviour/... --test_output=streamed --jobs=1 &&
- # export TEST_SUCCESS=0 || export TEST_SUCCESS=1
- # tool/test/stop-cluster-servers.sh
- # exit $TEST_SUCCESS
+ # TODO: Use cluster server artifact with 3 nodes when available (it currently uses 1)
+ test-java-behaviour-cluster:
+ image: typedb-ubuntu-22.04
+ dependencies:
+ - build
+ command: |
+ export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
+ export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
+ bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
+ bazel run @typedb_dependencies//distribution/artifact:create-netrc
+
+ source tool/test/start-cluster-servers.sh 1 &&
+ .factory/test-cluster.sh //java/test/behaviour/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
+ export TEST_SUCCESS=0 || export TEST_SUCCESS=1
+ tool/test/stop-cluster-servers.sh
+ exit $TEST_SUCCESS
test-python-integration:
image: typedb-ubuntu-22.04
@@ -240,7 +240,7 @@ build:
if [[ -n "$COMMUNITY_FAILED" ]]; then exit 1; fi
# TODO: Use cluster server artifact with 3 nodes when available
- # tool/test/start-cluster-servers.sh 3 &&
+ # source tool/test/start-cluster-servers.sh 3 &&
# bazel test //python/tests/integration:all --test_output=streamed --jobs=1 &&
# export CLUSTER_FAILED= || export CLUSTER_FAILED=1
# tool/test/stop-cluster-servers.sh
@@ -264,24 +264,24 @@ build:
tool/test/stop-community-server.sh
exit $TEST_SUCCESS
- # TODO: Use cluster server artifact with 3 nodes when available (it would do the same thing as community now)
- # test-python-behaviour-cluster:
- # image: typedb-ubuntu-22.04
- # dependencies:
- # - build
- # type: foreground
- # command: |
- # export PATH="$HOME/.local/bin:$PATH"
- # export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
- # export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
- # bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
- # bazel run @typedb_dependencies//distribution/artifact:create-netrc
- #
- # tool/test/start-cluster-servers.sh 3 &&
- # .factory/test-cluster.sh //python/tests/behaviour/... --test_output=streamed --jobs=1 &&
- # export TEST_SUCCESS=0 || export TEST_SUCCESS=1
- # tool/test/stop-cluster-servers.sh
- # exit $TEST_SUCCESS
+ # TODO: Use cluster server artifact with 3 nodes when available (it currently uses 1)
+ test-python-behaviour-cluster:
+ image: typedb-ubuntu-22.04
+ dependencies:
+ - build
+ type: foreground
+ command: |
+ export PATH="$HOME/.local/bin:$PATH"
+ export ARTIFACT_USERNAME=$REPO_TYPEDB_USERNAME
+ export ARTIFACT_PASSWORD=$REPO_TYPEDB_PASSWORD
+ bazel run @typedb_dependencies//tool/bazelinstall:remote_cache_setup.sh
+ bazel run @typedb_dependencies//distribution/artifact:create-netrc
+
+ source tool/test/start-cluster-servers.sh 1 &&
+ .factory/test-cluster.sh //python/tests/behaviour/... --test_env=ROOT_CA=$ROOT_CA --test_output=streamed --jobs=1 &&
+ export TEST_SUCCESS=0 || export TEST_SUCCESS=1
+ tool/test/stop-cluster-servers.sh
+ exit $TEST_SUCCESS
# test-nodejs-integration:
# image: typedb-ubuntu-22.04
diff --git a/Cargo.lock b/Cargo.lock
index 1890760f27..527c2e32d0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1397,10 +1397,11 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "js-sys"
-version = "0.3.70"
+version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
+checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
+ "once_cell",
"wasm-bindgen",
]
@@ -1464,9 +1465,9 @@ dependencies = [
[[package]]
name = "macro_rules_attribute"
-version = "0.2.0"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a82271f7bc033d84bbca59a3ce3e4159938cb08a9c3aebbe54d215131518a13"
+checksum = "65049d7923698040cd0b1ddcced9b0eb14dd22c5f86ae59c3740eab64a676520"
dependencies = [
"macro_rules_attribute-proc_macro",
"paste",
@@ -1474,9 +1475,9 @@ dependencies = [
[[package]]
name = "macro_rules_attribute-proc_macro"
-version = "0.2.0"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8dd856d451cc0da70e2ef2ce95a18e39a93b7558bedf10201ad28503f918568"
+checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30"
[[package]]
name = "matchit"
@@ -1899,9 +1900,9 @@ dependencies = [
[[package]]
name = "prost-types"
-version = "0.13.2"
+version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60caa6738c7369b940c3d49246a8d1749323674c65cb13010134f5c9bad5b519"
+checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16"
dependencies = [
"prost",
]
@@ -2753,7 +2754,7 @@ dependencies = [
[[package]]
name = "typedb-protocol"
version = "0.0.0"
-source = "git+https://github.com/typedb/typedb-protocol?rev=38f66a1cc4db3b7a301676f50800e9530ac5c8a3#38f66a1cc4db3b7a301676f50800e9530ac5c8a3"
+source = "git+https://github.com/typedb/typedb-protocol?rev=d1b71067c7e78364c69701625ea3f6d6b1f24a9d#d1b71067c7e78364c69701625ea3f6d6b1f24a9d"
dependencies = [
"prost",
"tonic",
@@ -2818,13 +2819,15 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "uuid"
-version = "1.16.0"
+version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
+checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d"
dependencies = [
"getrandom 0.3.1",
+ "js-sys",
"rand 0.9.0",
"serde",
+ "wasm-bindgen",
]
[[package]]
@@ -2881,24 +2884,24 @@ dependencies = [
[[package]]
name = "wasm-bindgen"
-version = "0.2.93"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
+checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
"once_cell",
+ "rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.93"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
+checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
- "once_cell",
"proc-macro2",
"quote",
"syn 2.0.87",
@@ -2919,9 +2922,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.93"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
+checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -2929,9 +2932,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.93"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
+checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
@@ -2942,9 +2945,12 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.93"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
+checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
+dependencies = [
+ "unicode-ident",
+]
[[package]]
name = "web-sys"
diff --git a/c/README.md b/c/README.md
index efe4d17554..cc64790257 100644
--- a/c/README.md
+++ b/c/README.md
@@ -22,13 +22,13 @@ Code examples can be found in the [integration tests](https://github.com/typedb/
Functions parameters & return values are either primitives or pointers to opaque structs, e.g.:
```c
-Driver *driver_open_core(const char *address);
+Driver *driver_new_core(const char *address);
```
These pointers are then used for further operations:
```c
char* dbName = "hello";
- Driver *driver = driver_open_core("127.0.0.1:1729");
+ Driver *driver = driver_new_core("127.0.0.1:1729");
DatabaseManager* databaseManager = database_manager_new(driver);
databases_create(databaseManager, dbName);
Database* database = databases_get(databaseManager, dbName);
diff --git a/c/src/answer.rs b/c/src/answer.rs
index d8d32c2fb9..3c298b77e6 100644
--- a/c/src/answer.rs
+++ b/c/src/answer.rs
@@ -26,16 +26,14 @@ use typedb_driver::{
BoxPromise, Promise, Result,
};
-use super::{
- concept::ConceptIterator,
- iterator::CIterator,
- memory::{borrow, free, release, release_optional, release_string, string_view},
-};
use crate::{
- common::StringIterator,
- concept::ConceptRowIterator,
- error::{try_release, try_release_optional},
- memory::take_ownership,
+ common::{
+ error::{try_release, try_release_optional},
+ iterator::CIterator,
+ memory::{borrow, free, release, release_string, string_view, take_ownership},
+ StringIterator,
+ },
+ concept::{ConceptIterator, ConceptRowIterator},
};
/// Promise object representing the result of an asynchronous operation.
@@ -62,7 +60,7 @@ pub extern "C" fn query_answer_promise_drop(promise: *mut QueryAnswerPromise) {
drop(take_ownership(promise))
}
-/// Retrieve the executed query's type of the QueryAnswer
.
+/// Retrieves the executed query's type of the QueryAnswer
.
#[no_mangle]
pub extern "C" fn query_answer_get_query_type(query_answer: *const QueryAnswer) -> QueryType {
borrow(query_answer).get_query_type()
@@ -120,7 +118,7 @@ pub extern "C" fn concept_row_get_column_names(concept_row: *const ConceptRow) -
release(StringIterator(CIterator(box_stream(borrow(concept_row).get_column_names().into_iter().cloned().map(Ok)))))
}
-/// Retrieve the executed query's type of the ConceptRow
's header.
+/// Retrieves the executed query's type of the ConceptRow
's header.
#[no_mangle]
pub extern "C" fn concept_row_get_query_type(concept_row: *const ConceptRow) -> QueryType {
borrow(concept_row).get_query_type()
diff --git a/c/src/error.rs b/c/src/common/error.rs
similarity index 86%
rename from c/src/error.rs
rename to c/src/common/error.rs
index 57ed509aa4..d86a9563f1 100644
--- a/c/src/error.rs
+++ b/c/src/common/error.rs
@@ -57,35 +57,35 @@ fn ok_record_flatten(result: Option>) -> Option {
result.and_then(ok_record)
}
-pub(super) fn try_release(result: Result) -> *mut T {
+pub(crate) fn try_release(result: Result) -> *mut T {
release_optional(ok_record(result))
}
-pub(super) fn try_release_optional(result: Option>) -> *mut T {
+pub(crate) fn try_release_optional(result: Option>) -> *mut T {
release_optional(ok_record_flatten(result))
}
-pub(super) fn try_release_string(result: Result) -> *mut c_char {
+pub(crate) fn try_release_string(result: Result) -> *mut c_char {
ok_record(result).map(release_string).unwrap_or_else(null_mut)
}
-pub(super) fn try_release_optional_string(result: Option>) -> *mut c_char {
+pub(crate) fn try_release_optional_string(result: Option>) -> *mut c_char {
ok_record_flatten(result).map(release_string).unwrap_or_else(null_mut)
}
-pub(super) fn try_release_arc(result: Result>) -> *const T {
+pub(crate) fn try_release_arc(result: Result>) -> *const T {
try_release_optional_arc(ok_record(result))
}
-pub(super) fn try_release_optional_arc(result: Option>) -> *const T {
+pub(crate) fn try_release_optional_arc(result: Option>) -> *const T {
result.map(release_arc).unwrap_or_else(null)
}
-pub(super) fn unwrap_or_default(result: Result) -> T {
+pub(crate) fn unwrap_or_default(result: Result) -> T {
ok_record(result).unwrap_or_default()
}
-pub(super) fn unwrap_void(result: Result) {
+pub(crate) fn unwrap_void(result: Result) {
ok_record(result);
}
diff --git a/c/src/iterator.rs b/c/src/common/iterator.rs
similarity index 77%
rename from c/src/iterator.rs
rename to c/src/common/iterator.rs
index 2a3874b56a..5143cf8001 100644
--- a/c/src/iterator.rs
+++ b/c/src/common/iterator.rs
@@ -22,21 +22,20 @@ use std::sync::Arc;
use typedb_driver::{BoxStream, Result};
use super::{
- error::try_release_optional,
+ error::{try_release_optional, try_release_optional_arc},
memory::{borrow_mut, release_optional},
};
-use crate::error::try_release_optional_arc;
-pub struct CIterator(pub(super) BoxStream<'static, T>);
+pub struct CIterator(pub(crate) BoxStream<'static, T>);
-pub(super) fn iterator_next(it: *mut CIterator) -> *mut T {
+pub(crate) fn iterator_next(it: *mut CIterator) -> *mut T {
release_optional(borrow_mut(it).0.next())
}
-pub(super) fn iterator_try_next(it: *mut CIterator>) -> *mut T {
+pub(crate) fn iterator_try_next(it: *mut CIterator>) -> *mut T {
try_release_optional(borrow_mut(it).0.next())
}
-pub(super) fn iterator_arc_next(it: *mut CIterator>) -> *const T {
+pub(crate) fn iterator_arc_next(it: *mut CIterator>) -> *const T {
try_release_optional_arc(borrow_mut(it).0.next())
}
diff --git a/c/src/memory.rs b/c/src/common/memory.rs
similarity index 78%
rename from c/src/memory.rs
rename to c/src/common/memory.rs
index 4aa959c8c6..5557d00fb5 100644
--- a/c/src/memory.rs
+++ b/c/src/common/memory.rs
@@ -20,7 +20,7 @@
use std::{
cell::RefCell,
ffi::{c_char, CStr, CString},
- ptr::{null, null_mut},
+ ptr::null_mut,
sync::Arc,
};
@@ -31,74 +31,74 @@ thread_local! {
static LAST_ERROR: RefCell