From c7bcd4f3a6a6363586c00e92eadd334358c57d40 Mon Sep 17 00:00:00 2001 From: David Bottiau Date: Thu, 22 Aug 2024 10:35:54 +0200 Subject: [PATCH 1/3] feat: allow cbor uuid serialization for record id part (#4491) Co-authored-by: Micha de Vries Co-authored-by: Tobie Morgan Hitchcock Co-authored-by: Mees Delzenne --- core/src/idx/planner/rewriter.rs | 2 +- core/src/key/thing/mod.rs | 4 ++-- core/src/rpc/format/cbor/convert.rs | 27 ++++++++++++++++++++------- core/src/sql/id/mod.rs | 8 ++++++-- core/src/sql/uuid.rs | 4 +++- core/src/sql/value/value.rs | 1 + core/src/syn/parser/thing.rs | 6 +++++- lib/tests/create.rs | 2 +- 8 files changed, 39 insertions(+), 15 deletions(-) diff --git a/core/src/idx/planner/rewriter.rs b/core/src/idx/planner/rewriter.rs index 0c8127439d1d..639d4d5f007f 100644 --- a/core/src/idx/planner/rewriter.rs +++ b/core/src/idx/planner/rewriter.rs @@ -125,7 +125,7 @@ impl<'a> KnnConditionRewriter<'a> { fn eval_id(&self, id: &Id) -> Option { match id { - Id::Number(_) | Id::String(_) | Id::Generate(_) => Some(id.clone()), + Id::Number(_) | Id::String(_) | Id::Generate(_) | Id::Uuid(_) => Some(id.clone()), Id::Array(a) => self.eval_array(a).map(Id::Array), Id::Object(o) => self.eval_object(o).map(Id::Object), Id::Range(r) => self.eval_id_range(r).map(|v| Id::Range(Box::new(v))), diff --git a/core/src/key/thing/mod.rs b/core/src/key/thing/mod.rs index d7145a6ca0f4..3559f23c10df 100644 --- a/core/src/key/thing/mod.rs +++ b/core/src/key/thing/mod.rs @@ -86,7 +86,7 @@ mod tests { let id1 = thing.id; let val = Thing::new("testns", "testdb", "testtb", id1); let enc = Thing::encode(&val).unwrap(); - assert_eq!(enc, b"/*testns\0*testdb\0*testtb\0*\0\0\0\x02\0\0\0\x04test\0\x01"); + assert_eq!(enc, b"/*testns\0*testdb\0*testtb\0*\0\0\0\x03\0\0\0\x04test\0\x01"); let dec = Thing::decode(&enc).unwrap(); assert_eq!(val, dec); @@ -96,7 +96,7 @@ mod tests { let id2 = thing.id; let val = Thing::new("testns", "testdb", "testtb", id2); let enc = Thing::encode(&val).unwrap(); - assert_eq!(enc, b"/*testns\0*testdb\0*testtb\0*\0\0\0\x02\0\0\0\x07\0\0\0\0\0\0\0\x10\xf8\xe2\x38\xf2\xe7\x34\x47\xb8\x9a\x16\x47\x6b\x29\x1b\xd7\x8a\x01"); + assert_eq!(enc, b"/*testns\0*testdb\0*testtb\0*\0\0\0\x03\0\0\0\x07\0\0\0\0\0\0\0\x10\xf8\xe2\x38\xf2\xe7\x34\x47\xb8\x9a\x16\x47\x6b\x29\x1b\xd7\x8a\x01"); let dec = Thing::decode(&enc).unwrap(); assert_eq!(val, dec); diff --git a/core/src/rpc/format/cbor/convert.rs b/core/src/rpc/format/cbor/convert.rs index 615850ddc1aa..5b1af9c90a99 100644 --- a/core/src/rpc/format/cbor/convert.rs +++ b/core/src/rpc/format/cbor/convert.rs @@ -116,13 +116,7 @@ impl TryFrom for Value { _ => Err("Expected a CBOR text data type"), }, // A byte string uuid - TAG_SPEC_UUID => match *v { - Data::Bytes(v) if v.len() == 16 => match v.as_slice().try_into() { - Ok(v) => Ok(Value::Uuid(Uuid::from(uuid::Uuid::from_bytes(v)))), - Err(_) => Err("Expected a CBOR byte array with 16 elements"), - }, - _ => Err("Expected a CBOR byte array with 16 elements"), - }, + TAG_SPEC_UUID => v.deref().to_owned().try_into().map(Value::Uuid), // A literal decimal TAG_STRING_DECIMAL => match *v { Data::Text(v) => match Decimal::from_str(v.as_str()) { @@ -393,6 +387,7 @@ impl TryFrom for Cbor { match v.id { Id::Number(v) => Data::Integer(v.into()), Id::String(v) => Data::Text(v), + Id::Uuid(v) => Cbor::try_from(Value::from(v))?.0, Id::Array(v) => Cbor::try_from(Value::from(v))?.0, Id::Object(v) => Cbor::try_from(Value::from(v))?.0, Id::Generate(_) => { @@ -564,6 +559,8 @@ impl TryFrom for Id { Data::Array(v) => Ok(Id::Array(v.try_into()?)), Data::Map(v) => Ok(Id::Object(v.try_into()?)), Data::Tag(TAG_RANGE, v) => Ok(Id::Range(Box::new(IdRange::try_from(*v)?))), + Data::Tag(TAG_STRING_UUID, v) => v.deref().to_owned().try_into().map(Id::Uuid), + Data::Tag(TAG_SPEC_UUID, v) => v.deref().to_owned().try_into().map(Id::Uuid), _ => Err("Expected a CBOR integer, text, array or map"), } } @@ -578,6 +575,9 @@ impl TryFrom for Data { Id::Array(v) => Ok(Cbor::try_from(Value::from(v))?.0), Id::Object(v) => Ok(Cbor::try_from(Value::from(v))?.0), Id::Range(v) => Ok(Data::Tag(TAG_RANGE, Box::new(v.deref().to_owned().try_into()?))), + Id::Uuid(v) => { + Ok(Data::Tag(TAG_SPEC_UUID, Box::new(Data::Bytes(v.into_bytes().into())))) + } Id::Generate(_) => Err("Cannot encode an ungenerated Record ID into CBOR"), } } @@ -604,3 +604,16 @@ impl TryFrom> for Object { )) } } + +impl TryFrom for Uuid { + type Error = &'static str; + fn try_from(val: Data) -> Result { + match val { + Data::Bytes(v) if v.len() == 16 => match v.as_slice().try_into() { + Ok(v) => Ok(Uuid::from(uuid::Uuid::from_bytes(v))), + Err(_) => Err("Expected a CBOR byte array with 16 elements"), + }, + _ => Err("Expected a CBOR byte array with 16 elements"), + } + } +} diff --git a/core/src/sql/id/mod.rs b/core/src/sql/id/mod.rs index 229c350860fe..ac5e4f8bfa83 100644 --- a/core/src/sql/id/mod.rs +++ b/core/src/sql/id/mod.rs @@ -35,6 +35,7 @@ pub enum Gen { pub enum Id { Number(i64), String(String), + Uuid(Uuid), Array(Array), Object(Object), Generate(Gen), @@ -79,7 +80,7 @@ impl From for Id { impl From for Id { fn from(v: Uuid) -> Self { - Self::String(v.to_raw()) + Self::Uuid(v) } } @@ -188,13 +189,14 @@ impl Id { } /// Generate a new random UUID pub fn uuid() -> Self { - Self::String(Uuid::new_v7().to_raw()) + Self::Uuid(Uuid::new_v7()) } /// Convert the Id to a raw String pub fn to_raw(&self) -> String { match self { Self::Number(v) => v.to_string(), Self::String(v) => v.to_string(), + Self::Uuid(v) => v.to_string(), Self::Array(v) => v.to_string(), Self::Object(v) => v.to_string(), Self::Generate(v) => match v { @@ -212,6 +214,7 @@ impl Display for Id { match self { Self::Number(v) => Display::fmt(v, f), Self::String(v) => Display::fmt(&escape_rid(v), f), + Self::Uuid(v) => Display::fmt(v, f), Self::Array(v) => Display::fmt(v, f), Self::Object(v) => Display::fmt(v, f), Self::Generate(v) => match v { @@ -236,6 +239,7 @@ impl Id { match self { Id::Number(v) => Ok(Id::Number(*v)), Id::String(v) => Ok(Id::String(v.clone())), + Id::Uuid(v) => Ok(Id::Uuid(*v)), Id::Array(v) => match v.compute(stk, ctx, opt, doc).await? { Value::Array(v) => Ok(Id::Array(v)), _ => unreachable!(), diff --git a/core/src/sql/uuid.rs b/core/src/sql/uuid.rs index 8a38f59491d1..bdb8f552c6f8 100644 --- a/core/src/sql/uuid.rs +++ b/core/src/sql/uuid.rs @@ -11,7 +11,9 @@ use super::Datetime; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Uuid"; #[revisioned(revision = 1)] -#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] +#[derive( + Clone, Copy, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Hash, +)] #[serde(rename = "$surrealdb::private::sql::Uuid")] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[non_exhaustive] diff --git a/core/src/sql/value/value.rs b/core/src/sql/value/value.rs index 01b2ef6a2bdb..4820744382a1 100644 --- a/core/src/sql/value/value.rs +++ b/core/src/sql/value/value.rs @@ -600,6 +600,7 @@ impl From for Value { match v { Id::Number(v) => v.into(), Id::String(v) => v.into(), + Id::Uuid(v) => v.into(), Id::Array(v) => v.into(), Id::Object(v) => v.into(), Id::Generate(v) => match v { diff --git a/core/src/syn/parser/thing.rs b/core/src/syn/parser/thing.rs index 65b3876e9924..f95404505445 100644 --- a/core/src/syn/parser/thing.rs +++ b/core/src/syn/parser/thing.rs @@ -32,7 +32,10 @@ impl Parser<'_> { fn kind_cast_start_id(kind: TokenKind) -> bool { Self::tokenkind_can_start_ident(kind) - || matches!(kind, TokenKind::Digits | t!("{") | t!("[") | t!("+") | t!("-")) + || matches!( + kind, + TokenKind::Digits | t!("{") | t!("[") | t!("+") | t!("-") | t!("u'") | t!("u\"") + ) } pub async fn parse_thing_or_range( @@ -187,6 +190,7 @@ impl Parser<'_> { pub async fn parse_id(&mut self, stk: &mut Stk) -> ParseResult { let token = self.peek_whitespace(); match token.kind { + t!("u'") | t!("u\"") => Ok(Id::Uuid(self.next_token_value()?)), t!("{") => { self.pop_peek(); // object record id diff --git a/lib/tests/create.rs b/lib/tests/create.rs index 81955a997d8f..f89bd98a8616 100644 --- a/lib/tests/create.rs +++ b/lib/tests/create.rs @@ -94,7 +94,7 @@ async fn create_with_id() -> Result<(), Error> { let val = Value::parse( "[ { - id: city:⟨8e60244d-95f6-4f95-9e30-09a98977efb0⟩, + id: city:u'8e60244d-95f6-4f95-9e30-09a98977efb0', name: 'London' } ]", From b23b25b7d124175ac572427c472c49c26ff3f0c4 Mon Sep 17 00:00:00 2001 From: Micha de Vries Date: Thu, 22 Aug 2024 09:41:11 +0100 Subject: [PATCH 2/3] Fix record id escaping to match parser (#4580) --- core/src/iam/verify.rs | 2 +- core/src/sql/escape.rs | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/core/src/iam/verify.rs b/core/src/iam/verify.rs index 8fde54ead4aa..420961090358 100644 --- a/core/src/iam/verify.rs +++ b/core/src/iam/verify.rs @@ -1467,7 +1467,7 @@ mod tests { // Test with generic user identifier // { - let resource_id = "user:⟨2k9qnabxuxh8k4d5gfto⟩".to_string(); + let resource_id = "user:2k9qnabxuxh8k4d5gfto".to_string(); // Prepare the claims object let mut claims = claims.clone(); claims.id = Some(resource_id.clone()); diff --git a/core/src/sql/escape.rs b/core/src/sql/escape.rs index f1df3b50fa75..1badad4bc829 100644 --- a/core/src/sql/escape.rs +++ b/core/src/sql/escape.rs @@ -65,7 +65,7 @@ pub fn escape_key(s: &str) -> Cow<'_, str> { #[inline] /// Escapes an id if necessary pub fn escape_rid(s: &str) -> Cow<'_, str> { - escape_numeric(s, BRACKETL, BRACKETR, BRACKET_ESC) + escape_full_numeric(s, BRACKETL, BRACKETR, BRACKET_ESC) } #[inline] @@ -74,7 +74,7 @@ pub fn escape_ident(s: &str) -> Cow<'_, str> { if let Some(x) = escape_reserved_keyword(s) { return Cow::Owned(x); } - escape_numeric(s, BACKTICK, BACKTICK, BACKTICK_ESC) + escape_starts_numeric(s, BACKTICK, BACKTICK, BACKTICK_ESC) } #[inline] @@ -95,7 +95,29 @@ pub fn escape_reserved_keyword(s: &str) -> Option { } #[inline] -pub fn escape_numeric<'a>(s: &'a str, l: char, r: char, e: &str) -> Cow<'a, str> { +pub fn escape_full_numeric<'a>(s: &'a str, l: char, r: char, e: &str) -> Cow<'a, str> { + let mut numeric = true; + // Loop over each character + for x in s.bytes() { + // Check if character is allowed + if !(x.is_ascii_alphanumeric() || x == b'_') { + return Cow::Owned(format!("{l}{}{r}", s.replace(r, e))); + } + // For every character, we need to check if it is a digit until we encounter a non-digit + if numeric && !x.is_ascii_digit() { + numeric = false; + } + } + + // If all characters are digits, then we need to escape the string + if numeric { + return Cow::Owned(format!("{l}{}{r}", s.replace(r, e))); + } + Cow::Borrowed(s) +} + +#[inline] +pub fn escape_starts_numeric<'a>(s: &'a str, l: char, r: char, e: &str) -> Cow<'a, str> { // Loop over each character for (idx, x) in s.bytes().enumerate() { // the first character is not allowed to be a digit. From 898d75b744b0c495a6eaa14385225b35ae4a45f3 Mon Sep 17 00:00:00 2001 From: Rushmore Mushambi Date: Thu, 22 Aug 2024 11:26:03 +0100 Subject: [PATCH 3/3] Rename `lib` to `sdk` (#4561) --- .github/CODEOWNERS | 4 ++-- .github/workflows/ci.yml | 2 +- Cargo.toml | 10 +++++----- build.rs | 2 +- core/Cargo.toml | 2 +- core/src/fnc/mod.rs | 2 +- core/src/gql/schema.rs | 3 +++ {lib => sdk}/CARGO.md | 0 {lib => sdk}/Cargo.toml | 0 {lib => sdk}/README.md | 0 {lib => sdk}/benches/README.md | 0 {lib => sdk}/benches/executor.rs | 0 {lib => sdk}/benches/hash_trie_btree.rs | 0 {lib => sdk}/benches/hashset_vs_vector.rs | 0 {lib => sdk}/benches/index_btree.rs | 0 {lib => sdk}/benches/index_hnsw.rs | 0 {lib => sdk}/benches/index_mtree.rs | 0 {lib => sdk}/benches/move_vs_clone.rs | 0 {lib => sdk}/benches/parser.rs | 0 {lib => sdk}/benches/processor.rs | 0 {lib => sdk}/benches/sdb.rs | 0 {lib => sdk}/benches/sdb_benches/lib/mod.rs | 0 .../benches/sdb_benches/lib/routines/create.rs | 0 {lib => sdk}/benches/sdb_benches/lib/routines/mod.rs | 0 {lib => sdk}/benches/sdb_benches/lib/routines/read.rs | 0 {lib => sdk}/benches/sdb_benches/mod.rs | 0 {lib => sdk}/benches/sdb_benches/sdk/mod.rs | 0 .../benches/sdb_benches/sdk/routines/create.rs | 0 {lib => sdk}/benches/sdb_benches/sdk/routines/mod.rs | 0 {lib => sdk}/benches/sdb_benches/sdk/routines/read.rs | 0 {lib => sdk}/build.rs | 0 {lib => sdk}/examples/actix/Cargo.toml | 0 {lib => sdk}/examples/actix/src/error.rs | 0 {lib => sdk}/examples/actix/src/main.rs | 0 {lib => sdk}/examples/actix/src/person.rs | 0 {lib => sdk}/examples/axum/Cargo.toml | 0 {lib => sdk}/examples/axum/src/error.rs | 0 {lib => sdk}/examples/axum/src/lib.rs | 0 {lib => sdk}/examples/axum/src/main.rs | 0 {lib => sdk}/examples/axum/src/person.rs | 0 {lib => sdk}/examples/concurrency/main.rs | 0 {lib => sdk}/examples/fetch/main.rs | 0 {lib => sdk}/examples/live/main.rs | 0 {lib => sdk}/examples/query/main.rs | 0 {lib => sdk}/examples/rocket/Cargo.toml | 0 {lib => sdk}/examples/rocket/Rocket.toml | 0 {lib => sdk}/examples/rocket/src/error.rs | 0 {lib => sdk}/examples/rocket/src/lib.rs | 0 {lib => sdk}/examples/rocket/src/main.rs | 0 {lib => sdk}/examples/rocket/src/person.rs | 0 {lib => sdk}/examples/rocket/tests/integration_test.rs | 0 {lib => sdk}/examples/select/main.rs | 0 {lib => sdk}/examples/transaction/main.rs | 0 {lib => sdk}/examples/version/main.rs | 0 {lib => sdk}/fuzz/.gitignore | 0 {lib => sdk}/fuzz/Cargo.lock | 0 {lib => sdk}/fuzz/Cargo.toml | 0 {lib => sdk}/fuzz/README.md | 0 {lib => sdk}/fuzz/fuzz_targets/fuzz_executor.dict | 0 {lib => sdk}/fuzz/fuzz_targets/fuzz_executor.rs | 0 {lib => sdk}/fuzz/fuzz_targets/fuzz_sql_parser.dict | 0 {lib => sdk}/fuzz/fuzz_targets/fuzz_sql_parser.rs | 0 .../fuzz/fuzz_targets/fuzz_structured_executor.rs | 0 {lib => sdk}/src/api/conn/cmd.rs | 0 {lib => sdk}/src/api/conn/mod.rs | 0 {lib => sdk}/src/api/engine/any/mod.rs | 0 {lib => sdk}/src/api/engine/any/native.rs | 0 {lib => sdk}/src/api/engine/any/wasm.rs | 0 {lib => sdk}/src/api/engine/local/mod.rs | 0 {lib => sdk}/src/api/engine/local/native.rs | 0 {lib => sdk}/src/api/engine/local/wasm.rs | 0 {lib => sdk}/src/api/engine/mod.rs | 0 {lib => sdk}/src/api/engine/proto.rs | 0 {lib => sdk}/src/api/engine/remote/http/mod.rs | 0 {lib => sdk}/src/api/engine/remote/http/native.rs | 0 {lib => sdk}/src/api/engine/remote/http/wasm.rs | 0 {lib => sdk}/src/api/engine/remote/mod.rs | 0 {lib => sdk}/src/api/engine/remote/ws/mod.rs | 0 {lib => sdk}/src/api/engine/remote/ws/native.rs | 0 {lib => sdk}/src/api/engine/remote/ws/wasm.rs | 0 {lib => sdk}/src/api/engine/tasks.rs | 0 {lib => sdk}/src/api/err/mod.rs | 0 {lib => sdk}/src/api/headers/mod.rs | 0 {lib => sdk}/src/api/method/authenticate.rs | 0 {lib => sdk}/src/api/method/begin.rs | 0 {lib => sdk}/src/api/method/cancel.rs | 0 {lib => sdk}/src/api/method/commit.rs | 0 {lib => sdk}/src/api/method/content.rs | 0 {lib => sdk}/src/api/method/create.rs | 0 {lib => sdk}/src/api/method/delete.rs | 0 {lib => sdk}/src/api/method/export.rs | 0 {lib => sdk}/src/api/method/health.rs | 0 {lib => sdk}/src/api/method/import.rs | 0 {lib => sdk}/src/api/method/insert.rs | 0 {lib => sdk}/src/api/method/invalidate.rs | 0 {lib => sdk}/src/api/method/live.rs | 0 {lib => sdk}/src/api/method/merge.rs | 0 {lib => sdk}/src/api/method/mod.rs | 0 {lib => sdk}/src/api/method/patch.rs | 0 {lib => sdk}/src/api/method/query.rs | 0 {lib => sdk}/src/api/method/run.rs | 0 {lib => sdk}/src/api/method/select.rs | 0 {lib => sdk}/src/api/method/set.rs | 0 {lib => sdk}/src/api/method/signin.rs | 0 {lib => sdk}/src/api/method/signup.rs | 0 {lib => sdk}/src/api/method/tests/mod.rs | 0 {lib => sdk}/src/api/method/tests/protocol.rs | 0 {lib => sdk}/src/api/method/tests/server.rs | 0 {lib => sdk}/src/api/method/tests/types.rs | 0 {lib => sdk}/src/api/method/unset.rs | 0 {lib => sdk}/src/api/method/update.rs | 0 {lib => sdk}/src/api/method/upsert.rs | 0 {lib => sdk}/src/api/method/use_db.rs | 0 {lib => sdk}/src/api/method/use_ns.rs | 0 {lib => sdk}/src/api/method/version.rs | 0 {lib => sdk}/src/api/mod.rs | 0 {lib => sdk}/src/api/opt/auth.rs | 0 {lib => sdk}/src/api/opt/capabilities.rs | 0 {lib => sdk}/src/api/opt/config.rs | 0 {lib => sdk}/src/api/opt/endpoint/fdb.rs | 0 {lib => sdk}/src/api/opt/endpoint/http.rs | 0 {lib => sdk}/src/api/opt/endpoint/indxdb.rs | 0 {lib => sdk}/src/api/opt/endpoint/mem.rs | 0 {lib => sdk}/src/api/opt/endpoint/mod.rs | 0 {lib => sdk}/src/api/opt/endpoint/rocksdb.rs | 0 {lib => sdk}/src/api/opt/endpoint/surrealkv.rs | 0 {lib => sdk}/src/api/opt/endpoint/tikv.rs | 0 {lib => sdk}/src/api/opt/endpoint/ws.rs | 0 {lib => sdk}/src/api/opt/export.rs | 0 {lib => sdk}/src/api/opt/mod.rs | 0 {lib => sdk}/src/api/opt/query.rs | 0 {lib => sdk}/src/api/opt/resource.rs | 0 {lib => sdk}/src/api/opt/tls.rs | 0 {lib => sdk}/src/api/value/core.rs | 0 {lib => sdk}/src/api/value/mod.rs | 0 {lib => sdk}/src/api/value/obj.rs | 0 {lib => sdk}/src/lib.rs | 0 {lib => sdk}/src/mac/mod.rs | 0 {lib => sdk}/tests/access.rs | 0 {lib => sdk}/tests/alter.rs | 0 {lib => sdk}/tests/api.rs | 0 {lib => sdk}/tests/api/backup.rs | 0 {lib => sdk}/tests/api/live.rs | 0 {lib => sdk}/tests/api/mod.rs | 0 {lib => sdk}/tests/cache.rs | 0 {lib => sdk}/tests/cast.rs | 0 {lib => sdk}/tests/changefeeds.rs | 0 {lib => sdk}/tests/closure.rs | 0 {lib => sdk}/tests/compare.rs | 0 {lib => sdk}/tests/complex.rs | 0 {lib => sdk}/tests/create.rs | 0 {lib => sdk}/tests/datetimes.rs | 0 {lib => sdk}/tests/define.rs | 0 {lib => sdk}/tests/delete.rs | 0 {lib => sdk}/tests/escape.rs | 0 {lib => sdk}/tests/expression.rs | 0 {lib => sdk}/tests/fetch.rs | 0 {lib => sdk}/tests/field.rs | 0 {lib => sdk}/tests/foreach.rs | 0 {lib => sdk}/tests/function.rs | 0 {lib => sdk}/tests/future.rs | 0 {lib => sdk}/tests/geometry.rs | 0 {lib => sdk}/tests/group.rs | 0 {lib => sdk}/tests/helpers.rs | 0 {lib => sdk}/tests/idiom.rs | 0 {lib => sdk}/tests/info.rs | 0 {lib => sdk}/tests/insert.rs | 0 {lib => sdk}/tests/matches.rs | 0 {lib => sdk}/tests/merge.rs | 0 {lib => sdk}/tests/model.rs | 0 {lib => sdk}/tests/option.rs | 0 {lib => sdk}/tests/param.rs | 0 {lib => sdk}/tests/parse.rs | 0 {lib => sdk}/tests/planner.rs | 0 {lib => sdk}/tests/query.rs | 0 {lib => sdk}/tests/range.rs | 0 {lib => sdk}/tests/rebuild.rs | 0 {lib => sdk}/tests/relate.rs | 0 {lib => sdk}/tests/remove.rs | 0 {lib => sdk}/tests/return.rs | 0 {lib => sdk}/tests/running.md | 0 {lib => sdk}/tests/script.rs | 0 {lib => sdk}/tests/select.rs | 0 {lib => sdk}/tests/set.rs | 0 {lib => sdk}/tests/strict.rs | 0 {lib => sdk}/tests/subquery.rs | 0 {lib => sdk}/tests/table.rs | 0 {lib => sdk}/tests/throw.rs | 0 {lib => sdk}/tests/transaction.rs | 0 {lib => sdk}/tests/typing.rs | 0 {lib => sdk}/tests/update.rs | 0 {lib => sdk}/tests/upsert.rs | 0 {lib => sdk}/tests/util.rs | 0 {lib => sdk}/tests/vector.rs | 0 {lib => sdk}/tests/yuse.rs | 0 tests/README.md | 2 +- tests/sdk/local/Cargo.toml | 2 +- tests/sdk/remote/Cargo.toml | 2 +- 198 files changed, 17 insertions(+), 14 deletions(-) rename {lib => sdk}/CARGO.md (100%) rename {lib => sdk}/Cargo.toml (100%) rename {lib => sdk}/README.md (100%) rename {lib => sdk}/benches/README.md (100%) rename {lib => sdk}/benches/executor.rs (100%) rename {lib => sdk}/benches/hash_trie_btree.rs (100%) rename {lib => sdk}/benches/hashset_vs_vector.rs (100%) rename {lib => sdk}/benches/index_btree.rs (100%) rename {lib => sdk}/benches/index_hnsw.rs (100%) rename {lib => sdk}/benches/index_mtree.rs (100%) rename {lib => sdk}/benches/move_vs_clone.rs (100%) rename {lib => sdk}/benches/parser.rs (100%) rename {lib => sdk}/benches/processor.rs (100%) rename {lib => sdk}/benches/sdb.rs (100%) rename {lib => sdk}/benches/sdb_benches/lib/mod.rs (100%) rename {lib => sdk}/benches/sdb_benches/lib/routines/create.rs (100%) rename {lib => sdk}/benches/sdb_benches/lib/routines/mod.rs (100%) rename {lib => sdk}/benches/sdb_benches/lib/routines/read.rs (100%) rename {lib => sdk}/benches/sdb_benches/mod.rs (100%) rename {lib => sdk}/benches/sdb_benches/sdk/mod.rs (100%) rename {lib => sdk}/benches/sdb_benches/sdk/routines/create.rs (100%) rename {lib => sdk}/benches/sdb_benches/sdk/routines/mod.rs (100%) rename {lib => sdk}/benches/sdb_benches/sdk/routines/read.rs (100%) rename {lib => sdk}/build.rs (100%) rename {lib => sdk}/examples/actix/Cargo.toml (100%) rename {lib => sdk}/examples/actix/src/error.rs (100%) rename {lib => sdk}/examples/actix/src/main.rs (100%) rename {lib => sdk}/examples/actix/src/person.rs (100%) rename {lib => sdk}/examples/axum/Cargo.toml (100%) rename {lib => sdk}/examples/axum/src/error.rs (100%) rename {lib => sdk}/examples/axum/src/lib.rs (100%) rename {lib => sdk}/examples/axum/src/main.rs (100%) rename {lib => sdk}/examples/axum/src/person.rs (100%) rename {lib => sdk}/examples/concurrency/main.rs (100%) rename {lib => sdk}/examples/fetch/main.rs (100%) rename {lib => sdk}/examples/live/main.rs (100%) rename {lib => sdk}/examples/query/main.rs (100%) rename {lib => sdk}/examples/rocket/Cargo.toml (100%) rename {lib => sdk}/examples/rocket/Rocket.toml (100%) rename {lib => sdk}/examples/rocket/src/error.rs (100%) rename {lib => sdk}/examples/rocket/src/lib.rs (100%) rename {lib => sdk}/examples/rocket/src/main.rs (100%) rename {lib => sdk}/examples/rocket/src/person.rs (100%) rename {lib => sdk}/examples/rocket/tests/integration_test.rs (100%) rename {lib => sdk}/examples/select/main.rs (100%) rename {lib => sdk}/examples/transaction/main.rs (100%) rename {lib => sdk}/examples/version/main.rs (100%) rename {lib => sdk}/fuzz/.gitignore (100%) rename {lib => sdk}/fuzz/Cargo.lock (100%) rename {lib => sdk}/fuzz/Cargo.toml (100%) rename {lib => sdk}/fuzz/README.md (100%) rename {lib => sdk}/fuzz/fuzz_targets/fuzz_executor.dict (100%) rename {lib => sdk}/fuzz/fuzz_targets/fuzz_executor.rs (100%) rename {lib => sdk}/fuzz/fuzz_targets/fuzz_sql_parser.dict (100%) rename {lib => sdk}/fuzz/fuzz_targets/fuzz_sql_parser.rs (100%) rename {lib => sdk}/fuzz/fuzz_targets/fuzz_structured_executor.rs (100%) rename {lib => sdk}/src/api/conn/cmd.rs (100%) rename {lib => sdk}/src/api/conn/mod.rs (100%) rename {lib => sdk}/src/api/engine/any/mod.rs (100%) rename {lib => sdk}/src/api/engine/any/native.rs (100%) rename {lib => sdk}/src/api/engine/any/wasm.rs (100%) rename {lib => sdk}/src/api/engine/local/mod.rs (100%) rename {lib => sdk}/src/api/engine/local/native.rs (100%) rename {lib => sdk}/src/api/engine/local/wasm.rs (100%) rename {lib => sdk}/src/api/engine/mod.rs (100%) rename {lib => sdk}/src/api/engine/proto.rs (100%) rename {lib => sdk}/src/api/engine/remote/http/mod.rs (100%) rename {lib => sdk}/src/api/engine/remote/http/native.rs (100%) rename {lib => sdk}/src/api/engine/remote/http/wasm.rs (100%) rename {lib => sdk}/src/api/engine/remote/mod.rs (100%) rename {lib => sdk}/src/api/engine/remote/ws/mod.rs (100%) rename {lib => sdk}/src/api/engine/remote/ws/native.rs (100%) rename {lib => sdk}/src/api/engine/remote/ws/wasm.rs (100%) rename {lib => sdk}/src/api/engine/tasks.rs (100%) rename {lib => sdk}/src/api/err/mod.rs (100%) rename {lib => sdk}/src/api/headers/mod.rs (100%) rename {lib => sdk}/src/api/method/authenticate.rs (100%) rename {lib => sdk}/src/api/method/begin.rs (100%) rename {lib => sdk}/src/api/method/cancel.rs (100%) rename {lib => sdk}/src/api/method/commit.rs (100%) rename {lib => sdk}/src/api/method/content.rs (100%) rename {lib => sdk}/src/api/method/create.rs (100%) rename {lib => sdk}/src/api/method/delete.rs (100%) rename {lib => sdk}/src/api/method/export.rs (100%) rename {lib => sdk}/src/api/method/health.rs (100%) rename {lib => sdk}/src/api/method/import.rs (100%) rename {lib => sdk}/src/api/method/insert.rs (100%) rename {lib => sdk}/src/api/method/invalidate.rs (100%) rename {lib => sdk}/src/api/method/live.rs (100%) rename {lib => sdk}/src/api/method/merge.rs (100%) rename {lib => sdk}/src/api/method/mod.rs (100%) rename {lib => sdk}/src/api/method/patch.rs (100%) rename {lib => sdk}/src/api/method/query.rs (100%) rename {lib => sdk}/src/api/method/run.rs (100%) rename {lib => sdk}/src/api/method/select.rs (100%) rename {lib => sdk}/src/api/method/set.rs (100%) rename {lib => sdk}/src/api/method/signin.rs (100%) rename {lib => sdk}/src/api/method/signup.rs (100%) rename {lib => sdk}/src/api/method/tests/mod.rs (100%) rename {lib => sdk}/src/api/method/tests/protocol.rs (100%) rename {lib => sdk}/src/api/method/tests/server.rs (100%) rename {lib => sdk}/src/api/method/tests/types.rs (100%) rename {lib => sdk}/src/api/method/unset.rs (100%) rename {lib => sdk}/src/api/method/update.rs (100%) rename {lib => sdk}/src/api/method/upsert.rs (100%) rename {lib => sdk}/src/api/method/use_db.rs (100%) rename {lib => sdk}/src/api/method/use_ns.rs (100%) rename {lib => sdk}/src/api/method/version.rs (100%) rename {lib => sdk}/src/api/mod.rs (100%) rename {lib => sdk}/src/api/opt/auth.rs (100%) rename {lib => sdk}/src/api/opt/capabilities.rs (100%) rename {lib => sdk}/src/api/opt/config.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/fdb.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/http.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/indxdb.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/mem.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/mod.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/rocksdb.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/surrealkv.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/tikv.rs (100%) rename {lib => sdk}/src/api/opt/endpoint/ws.rs (100%) rename {lib => sdk}/src/api/opt/export.rs (100%) rename {lib => sdk}/src/api/opt/mod.rs (100%) rename {lib => sdk}/src/api/opt/query.rs (100%) rename {lib => sdk}/src/api/opt/resource.rs (100%) rename {lib => sdk}/src/api/opt/tls.rs (100%) rename {lib => sdk}/src/api/value/core.rs (100%) rename {lib => sdk}/src/api/value/mod.rs (100%) rename {lib => sdk}/src/api/value/obj.rs (100%) rename {lib => sdk}/src/lib.rs (100%) rename {lib => sdk}/src/mac/mod.rs (100%) rename {lib => sdk}/tests/access.rs (100%) rename {lib => sdk}/tests/alter.rs (100%) rename {lib => sdk}/tests/api.rs (100%) rename {lib => sdk}/tests/api/backup.rs (100%) rename {lib => sdk}/tests/api/live.rs (100%) rename {lib => sdk}/tests/api/mod.rs (100%) rename {lib => sdk}/tests/cache.rs (100%) rename {lib => sdk}/tests/cast.rs (100%) rename {lib => sdk}/tests/changefeeds.rs (100%) rename {lib => sdk}/tests/closure.rs (100%) rename {lib => sdk}/tests/compare.rs (100%) rename {lib => sdk}/tests/complex.rs (100%) rename {lib => sdk}/tests/create.rs (100%) rename {lib => sdk}/tests/datetimes.rs (100%) rename {lib => sdk}/tests/define.rs (100%) rename {lib => sdk}/tests/delete.rs (100%) rename {lib => sdk}/tests/escape.rs (100%) rename {lib => sdk}/tests/expression.rs (100%) rename {lib => sdk}/tests/fetch.rs (100%) rename {lib => sdk}/tests/field.rs (100%) rename {lib => sdk}/tests/foreach.rs (100%) rename {lib => sdk}/tests/function.rs (100%) rename {lib => sdk}/tests/future.rs (100%) rename {lib => sdk}/tests/geometry.rs (100%) rename {lib => sdk}/tests/group.rs (100%) rename {lib => sdk}/tests/helpers.rs (100%) rename {lib => sdk}/tests/idiom.rs (100%) rename {lib => sdk}/tests/info.rs (100%) rename {lib => sdk}/tests/insert.rs (100%) rename {lib => sdk}/tests/matches.rs (100%) rename {lib => sdk}/tests/merge.rs (100%) rename {lib => sdk}/tests/model.rs (100%) rename {lib => sdk}/tests/option.rs (100%) rename {lib => sdk}/tests/param.rs (100%) rename {lib => sdk}/tests/parse.rs (100%) rename {lib => sdk}/tests/planner.rs (100%) rename {lib => sdk}/tests/query.rs (100%) rename {lib => sdk}/tests/range.rs (100%) rename {lib => sdk}/tests/rebuild.rs (100%) rename {lib => sdk}/tests/relate.rs (100%) rename {lib => sdk}/tests/remove.rs (100%) rename {lib => sdk}/tests/return.rs (100%) rename {lib => sdk}/tests/running.md (100%) rename {lib => sdk}/tests/script.rs (100%) rename {lib => sdk}/tests/select.rs (100%) rename {lib => sdk}/tests/set.rs (100%) rename {lib => sdk}/tests/strict.rs (100%) rename {lib => sdk}/tests/subquery.rs (100%) rename {lib => sdk}/tests/table.rs (100%) rename {lib => sdk}/tests/throw.rs (100%) rename {lib => sdk}/tests/transaction.rs (100%) rename {lib => sdk}/tests/typing.rs (100%) rename {lib => sdk}/tests/update.rs (100%) rename {lib => sdk}/tests/upsert.rs (100%) rename {lib => sdk}/tests/util.rs (100%) rename {lib => sdk}/tests/vector.rs (100%) rename {lib => sdk}/tests/yuse.rs (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4b27491f23a4..b735c9e6a1d3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,13 +20,13 @@ Makefile.* @surrealdb/ci Cargo.lock @surrealdb/security Cargo.toml @surrealdb/security core/Cargo.toml @surrealdb/security -lib/Cargo.toml @surrealdb/security +sdk/Cargo.toml @surrealdb/security cackle.toml @surrealdb/security supply-chain/* @surrealdb/security deny.toml @surrealdb/security # Code for fuzzing configuration -/lib/fuzz/ @surrealdb/security +/sdk/fuzz/ @surrealdb/security SECURITY.md @surrealdb/security # Code and tests for indexing diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 141257340eb7..16a87f7d6856 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: save-if: ${{ github.ref == 'refs/heads/main' }} - name: Check fuzzers - run: cargo build --manifest-path lib/fuzz/Cargo.toml + run: cargo build --manifest-path sdk/fuzz/Cargo.toml - name: Check OSS-Fuzz uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master diff --git a/Cargo.toml b/Cargo.toml index 5a5846d2a679..b150b3a508ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,10 +33,10 @@ storage-fdb-7_3 = ["surrealdb-core/kv-fdb-7_3"] [workspace] members = [ "core", - "lib", - "lib/examples/actix", - "lib/examples/axum", - "lib/examples/rocket", + "sdk", + "sdk/examples/actix", + "sdk/examples/axum", + "sdk/examples/rocket", ] [profile.release] @@ -118,7 +118,7 @@ semver = "1.0.20" serde = { version = "1.0.193", features = ["derive"] } serde_json = "1.0.108" serde_pack = { version = "1.1.2", package = "rmp-serde" } -surrealdb = { version = "2", path = "lib", features = [ +surrealdb = { version = "2", path = "sdk", features = [ "protocol-http", "protocol-ws", "rustls", diff --git a/build.rs b/build.rs index a216876fdc07..263964452b63 100644 --- a/build.rs +++ b/build.rs @@ -6,7 +6,7 @@ const BUILD_METADATA: &str = "SURREAL_BUILD_METADATA"; fn main() { println!("cargo:rerun-if-env-changed={BUILD_METADATA}"); - println!("cargo:rerun-if-changed=lib"); + println!("cargo:rerun-if-changed=sdk"); println!("cargo:rerun-if-changed=src"); println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=Cargo.toml"); diff --git a/core/Cargo.toml b/core/Cargo.toml index 5907549d2749..cc41521681c0 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -4,7 +4,7 @@ publish = true edition = "2021" version = "2.0.0" rust-version = "1.77.0" -readme = "../lib/CARGO.md" +readme = "../sdk/CARGO.md" authors = ["Tobie Morgan Hitchcock "] description = "A scalable, distributed, collaborative, document-graph database, for the realtime web" repository = "https://github.com/surrealdb/surrealdb" diff --git a/core/src/fnc/mod.rs b/core/src/fnc/mod.rs index dd447ba1cbb4..20e7613e8a91 100644 --- a/core/src/fnc/mod.rs +++ b/core/src/fnc/mod.rs @@ -878,7 +878,7 @@ mod tests { for problem in problems { eprintln!(" - {problem}"); } - panic!("ensure functions can be parsed in lib/src/sql/function.rs and are exported to JS in lib/src/fnc/script/modules/surrealdb"); + panic!("ensure functions can be parsed in core/src/sql/function.rs and are exported to JS in core/src/fnc/script/modules/surrealdb"); } } } diff --git a/core/src/gql/schema.rs b/core/src/gql/schema.rs index b50d67b7a563..8e7607347f52 100644 --- a/core/src/gql/schema.rs +++ b/core/src/gql/schema.rs @@ -608,6 +608,7 @@ fn kind_to_type(kind: Kind, types: &mut Vec) -> Result Kind::Array(k, _) => TypeRef::List(Box::new(kind_to_type(*k, types)?)), Kind::Function(_, _) => return Err(schema_error("Kind::Function is not yet supported")), Kind::Range => return Err(schema_error("Kind::Range is not yet supported")), + Kind::Literal(_) => return Err(schema_error("Kind::Literal is not yet supported")), }; let out = match optional { @@ -672,6 +673,7 @@ fn filter_from_type( Kind::Array(_, _) => {} Kind::Function(_, _) => {} Kind::Range => {} + Kind::Literal(_) => {} }; Ok(filter) } @@ -1113,5 +1115,6 @@ fn gql_to_sql_kind(val: &GqlValue, kind: Kind) -> Result { }, Kind::Function(_, _) => Err(resolver_error("Sets are not yet supported")), Kind::Range => Err(resolver_error("Ranges are not yet supported")), + Kind::Literal(_) => Err(resolver_error("Literals are not yet supported")), } } diff --git a/lib/CARGO.md b/sdk/CARGO.md similarity index 100% rename from lib/CARGO.md rename to sdk/CARGO.md diff --git a/lib/Cargo.toml b/sdk/Cargo.toml similarity index 100% rename from lib/Cargo.toml rename to sdk/Cargo.toml diff --git a/lib/README.md b/sdk/README.md similarity index 100% rename from lib/README.md rename to sdk/README.md diff --git a/lib/benches/README.md b/sdk/benches/README.md similarity index 100% rename from lib/benches/README.md rename to sdk/benches/README.md diff --git a/lib/benches/executor.rs b/sdk/benches/executor.rs similarity index 100% rename from lib/benches/executor.rs rename to sdk/benches/executor.rs diff --git a/lib/benches/hash_trie_btree.rs b/sdk/benches/hash_trie_btree.rs similarity index 100% rename from lib/benches/hash_trie_btree.rs rename to sdk/benches/hash_trie_btree.rs diff --git a/lib/benches/hashset_vs_vector.rs b/sdk/benches/hashset_vs_vector.rs similarity index 100% rename from lib/benches/hashset_vs_vector.rs rename to sdk/benches/hashset_vs_vector.rs diff --git a/lib/benches/index_btree.rs b/sdk/benches/index_btree.rs similarity index 100% rename from lib/benches/index_btree.rs rename to sdk/benches/index_btree.rs diff --git a/lib/benches/index_hnsw.rs b/sdk/benches/index_hnsw.rs similarity index 100% rename from lib/benches/index_hnsw.rs rename to sdk/benches/index_hnsw.rs diff --git a/lib/benches/index_mtree.rs b/sdk/benches/index_mtree.rs similarity index 100% rename from lib/benches/index_mtree.rs rename to sdk/benches/index_mtree.rs diff --git a/lib/benches/move_vs_clone.rs b/sdk/benches/move_vs_clone.rs similarity index 100% rename from lib/benches/move_vs_clone.rs rename to sdk/benches/move_vs_clone.rs diff --git a/lib/benches/parser.rs b/sdk/benches/parser.rs similarity index 100% rename from lib/benches/parser.rs rename to sdk/benches/parser.rs diff --git a/lib/benches/processor.rs b/sdk/benches/processor.rs similarity index 100% rename from lib/benches/processor.rs rename to sdk/benches/processor.rs diff --git a/lib/benches/sdb.rs b/sdk/benches/sdb.rs similarity index 100% rename from lib/benches/sdb.rs rename to sdk/benches/sdb.rs diff --git a/lib/benches/sdb_benches/lib/mod.rs b/sdk/benches/sdb_benches/lib/mod.rs similarity index 100% rename from lib/benches/sdb_benches/lib/mod.rs rename to sdk/benches/sdb_benches/lib/mod.rs diff --git a/lib/benches/sdb_benches/lib/routines/create.rs b/sdk/benches/sdb_benches/lib/routines/create.rs similarity index 100% rename from lib/benches/sdb_benches/lib/routines/create.rs rename to sdk/benches/sdb_benches/lib/routines/create.rs diff --git a/lib/benches/sdb_benches/lib/routines/mod.rs b/sdk/benches/sdb_benches/lib/routines/mod.rs similarity index 100% rename from lib/benches/sdb_benches/lib/routines/mod.rs rename to sdk/benches/sdb_benches/lib/routines/mod.rs diff --git a/lib/benches/sdb_benches/lib/routines/read.rs b/sdk/benches/sdb_benches/lib/routines/read.rs similarity index 100% rename from lib/benches/sdb_benches/lib/routines/read.rs rename to sdk/benches/sdb_benches/lib/routines/read.rs diff --git a/lib/benches/sdb_benches/mod.rs b/sdk/benches/sdb_benches/mod.rs similarity index 100% rename from lib/benches/sdb_benches/mod.rs rename to sdk/benches/sdb_benches/mod.rs diff --git a/lib/benches/sdb_benches/sdk/mod.rs b/sdk/benches/sdb_benches/sdk/mod.rs similarity index 100% rename from lib/benches/sdb_benches/sdk/mod.rs rename to sdk/benches/sdb_benches/sdk/mod.rs diff --git a/lib/benches/sdb_benches/sdk/routines/create.rs b/sdk/benches/sdb_benches/sdk/routines/create.rs similarity index 100% rename from lib/benches/sdb_benches/sdk/routines/create.rs rename to sdk/benches/sdb_benches/sdk/routines/create.rs diff --git a/lib/benches/sdb_benches/sdk/routines/mod.rs b/sdk/benches/sdb_benches/sdk/routines/mod.rs similarity index 100% rename from lib/benches/sdb_benches/sdk/routines/mod.rs rename to sdk/benches/sdb_benches/sdk/routines/mod.rs diff --git a/lib/benches/sdb_benches/sdk/routines/read.rs b/sdk/benches/sdb_benches/sdk/routines/read.rs similarity index 100% rename from lib/benches/sdb_benches/sdk/routines/read.rs rename to sdk/benches/sdb_benches/sdk/routines/read.rs diff --git a/lib/build.rs b/sdk/build.rs similarity index 100% rename from lib/build.rs rename to sdk/build.rs diff --git a/lib/examples/actix/Cargo.toml b/sdk/examples/actix/Cargo.toml similarity index 100% rename from lib/examples/actix/Cargo.toml rename to sdk/examples/actix/Cargo.toml diff --git a/lib/examples/actix/src/error.rs b/sdk/examples/actix/src/error.rs similarity index 100% rename from lib/examples/actix/src/error.rs rename to sdk/examples/actix/src/error.rs diff --git a/lib/examples/actix/src/main.rs b/sdk/examples/actix/src/main.rs similarity index 100% rename from lib/examples/actix/src/main.rs rename to sdk/examples/actix/src/main.rs diff --git a/lib/examples/actix/src/person.rs b/sdk/examples/actix/src/person.rs similarity index 100% rename from lib/examples/actix/src/person.rs rename to sdk/examples/actix/src/person.rs diff --git a/lib/examples/axum/Cargo.toml b/sdk/examples/axum/Cargo.toml similarity index 100% rename from lib/examples/axum/Cargo.toml rename to sdk/examples/axum/Cargo.toml diff --git a/lib/examples/axum/src/error.rs b/sdk/examples/axum/src/error.rs similarity index 100% rename from lib/examples/axum/src/error.rs rename to sdk/examples/axum/src/error.rs diff --git a/lib/examples/axum/src/lib.rs b/sdk/examples/axum/src/lib.rs similarity index 100% rename from lib/examples/axum/src/lib.rs rename to sdk/examples/axum/src/lib.rs diff --git a/lib/examples/axum/src/main.rs b/sdk/examples/axum/src/main.rs similarity index 100% rename from lib/examples/axum/src/main.rs rename to sdk/examples/axum/src/main.rs diff --git a/lib/examples/axum/src/person.rs b/sdk/examples/axum/src/person.rs similarity index 100% rename from lib/examples/axum/src/person.rs rename to sdk/examples/axum/src/person.rs diff --git a/lib/examples/concurrency/main.rs b/sdk/examples/concurrency/main.rs similarity index 100% rename from lib/examples/concurrency/main.rs rename to sdk/examples/concurrency/main.rs diff --git a/lib/examples/fetch/main.rs b/sdk/examples/fetch/main.rs similarity index 100% rename from lib/examples/fetch/main.rs rename to sdk/examples/fetch/main.rs diff --git a/lib/examples/live/main.rs b/sdk/examples/live/main.rs similarity index 100% rename from lib/examples/live/main.rs rename to sdk/examples/live/main.rs diff --git a/lib/examples/query/main.rs b/sdk/examples/query/main.rs similarity index 100% rename from lib/examples/query/main.rs rename to sdk/examples/query/main.rs diff --git a/lib/examples/rocket/Cargo.toml b/sdk/examples/rocket/Cargo.toml similarity index 100% rename from lib/examples/rocket/Cargo.toml rename to sdk/examples/rocket/Cargo.toml diff --git a/lib/examples/rocket/Rocket.toml b/sdk/examples/rocket/Rocket.toml similarity index 100% rename from lib/examples/rocket/Rocket.toml rename to sdk/examples/rocket/Rocket.toml diff --git a/lib/examples/rocket/src/error.rs b/sdk/examples/rocket/src/error.rs similarity index 100% rename from lib/examples/rocket/src/error.rs rename to sdk/examples/rocket/src/error.rs diff --git a/lib/examples/rocket/src/lib.rs b/sdk/examples/rocket/src/lib.rs similarity index 100% rename from lib/examples/rocket/src/lib.rs rename to sdk/examples/rocket/src/lib.rs diff --git a/lib/examples/rocket/src/main.rs b/sdk/examples/rocket/src/main.rs similarity index 100% rename from lib/examples/rocket/src/main.rs rename to sdk/examples/rocket/src/main.rs diff --git a/lib/examples/rocket/src/person.rs b/sdk/examples/rocket/src/person.rs similarity index 100% rename from lib/examples/rocket/src/person.rs rename to sdk/examples/rocket/src/person.rs diff --git a/lib/examples/rocket/tests/integration_test.rs b/sdk/examples/rocket/tests/integration_test.rs similarity index 100% rename from lib/examples/rocket/tests/integration_test.rs rename to sdk/examples/rocket/tests/integration_test.rs diff --git a/lib/examples/select/main.rs b/sdk/examples/select/main.rs similarity index 100% rename from lib/examples/select/main.rs rename to sdk/examples/select/main.rs diff --git a/lib/examples/transaction/main.rs b/sdk/examples/transaction/main.rs similarity index 100% rename from lib/examples/transaction/main.rs rename to sdk/examples/transaction/main.rs diff --git a/lib/examples/version/main.rs b/sdk/examples/version/main.rs similarity index 100% rename from lib/examples/version/main.rs rename to sdk/examples/version/main.rs diff --git a/lib/fuzz/.gitignore b/sdk/fuzz/.gitignore similarity index 100% rename from lib/fuzz/.gitignore rename to sdk/fuzz/.gitignore diff --git a/lib/fuzz/Cargo.lock b/sdk/fuzz/Cargo.lock similarity index 100% rename from lib/fuzz/Cargo.lock rename to sdk/fuzz/Cargo.lock diff --git a/lib/fuzz/Cargo.toml b/sdk/fuzz/Cargo.toml similarity index 100% rename from lib/fuzz/Cargo.toml rename to sdk/fuzz/Cargo.toml diff --git a/lib/fuzz/README.md b/sdk/fuzz/README.md similarity index 100% rename from lib/fuzz/README.md rename to sdk/fuzz/README.md diff --git a/lib/fuzz/fuzz_targets/fuzz_executor.dict b/sdk/fuzz/fuzz_targets/fuzz_executor.dict similarity index 100% rename from lib/fuzz/fuzz_targets/fuzz_executor.dict rename to sdk/fuzz/fuzz_targets/fuzz_executor.dict diff --git a/lib/fuzz/fuzz_targets/fuzz_executor.rs b/sdk/fuzz/fuzz_targets/fuzz_executor.rs similarity index 100% rename from lib/fuzz/fuzz_targets/fuzz_executor.rs rename to sdk/fuzz/fuzz_targets/fuzz_executor.rs diff --git a/lib/fuzz/fuzz_targets/fuzz_sql_parser.dict b/sdk/fuzz/fuzz_targets/fuzz_sql_parser.dict similarity index 100% rename from lib/fuzz/fuzz_targets/fuzz_sql_parser.dict rename to sdk/fuzz/fuzz_targets/fuzz_sql_parser.dict diff --git a/lib/fuzz/fuzz_targets/fuzz_sql_parser.rs b/sdk/fuzz/fuzz_targets/fuzz_sql_parser.rs similarity index 100% rename from lib/fuzz/fuzz_targets/fuzz_sql_parser.rs rename to sdk/fuzz/fuzz_targets/fuzz_sql_parser.rs diff --git a/lib/fuzz/fuzz_targets/fuzz_structured_executor.rs b/sdk/fuzz/fuzz_targets/fuzz_structured_executor.rs similarity index 100% rename from lib/fuzz/fuzz_targets/fuzz_structured_executor.rs rename to sdk/fuzz/fuzz_targets/fuzz_structured_executor.rs diff --git a/lib/src/api/conn/cmd.rs b/sdk/src/api/conn/cmd.rs similarity index 100% rename from lib/src/api/conn/cmd.rs rename to sdk/src/api/conn/cmd.rs diff --git a/lib/src/api/conn/mod.rs b/sdk/src/api/conn/mod.rs similarity index 100% rename from lib/src/api/conn/mod.rs rename to sdk/src/api/conn/mod.rs diff --git a/lib/src/api/engine/any/mod.rs b/sdk/src/api/engine/any/mod.rs similarity index 100% rename from lib/src/api/engine/any/mod.rs rename to sdk/src/api/engine/any/mod.rs diff --git a/lib/src/api/engine/any/native.rs b/sdk/src/api/engine/any/native.rs similarity index 100% rename from lib/src/api/engine/any/native.rs rename to sdk/src/api/engine/any/native.rs diff --git a/lib/src/api/engine/any/wasm.rs b/sdk/src/api/engine/any/wasm.rs similarity index 100% rename from lib/src/api/engine/any/wasm.rs rename to sdk/src/api/engine/any/wasm.rs diff --git a/lib/src/api/engine/local/mod.rs b/sdk/src/api/engine/local/mod.rs similarity index 100% rename from lib/src/api/engine/local/mod.rs rename to sdk/src/api/engine/local/mod.rs diff --git a/lib/src/api/engine/local/native.rs b/sdk/src/api/engine/local/native.rs similarity index 100% rename from lib/src/api/engine/local/native.rs rename to sdk/src/api/engine/local/native.rs diff --git a/lib/src/api/engine/local/wasm.rs b/sdk/src/api/engine/local/wasm.rs similarity index 100% rename from lib/src/api/engine/local/wasm.rs rename to sdk/src/api/engine/local/wasm.rs diff --git a/lib/src/api/engine/mod.rs b/sdk/src/api/engine/mod.rs similarity index 100% rename from lib/src/api/engine/mod.rs rename to sdk/src/api/engine/mod.rs diff --git a/lib/src/api/engine/proto.rs b/sdk/src/api/engine/proto.rs similarity index 100% rename from lib/src/api/engine/proto.rs rename to sdk/src/api/engine/proto.rs diff --git a/lib/src/api/engine/remote/http/mod.rs b/sdk/src/api/engine/remote/http/mod.rs similarity index 100% rename from lib/src/api/engine/remote/http/mod.rs rename to sdk/src/api/engine/remote/http/mod.rs diff --git a/lib/src/api/engine/remote/http/native.rs b/sdk/src/api/engine/remote/http/native.rs similarity index 100% rename from lib/src/api/engine/remote/http/native.rs rename to sdk/src/api/engine/remote/http/native.rs diff --git a/lib/src/api/engine/remote/http/wasm.rs b/sdk/src/api/engine/remote/http/wasm.rs similarity index 100% rename from lib/src/api/engine/remote/http/wasm.rs rename to sdk/src/api/engine/remote/http/wasm.rs diff --git a/lib/src/api/engine/remote/mod.rs b/sdk/src/api/engine/remote/mod.rs similarity index 100% rename from lib/src/api/engine/remote/mod.rs rename to sdk/src/api/engine/remote/mod.rs diff --git a/lib/src/api/engine/remote/ws/mod.rs b/sdk/src/api/engine/remote/ws/mod.rs similarity index 100% rename from lib/src/api/engine/remote/ws/mod.rs rename to sdk/src/api/engine/remote/ws/mod.rs diff --git a/lib/src/api/engine/remote/ws/native.rs b/sdk/src/api/engine/remote/ws/native.rs similarity index 100% rename from lib/src/api/engine/remote/ws/native.rs rename to sdk/src/api/engine/remote/ws/native.rs diff --git a/lib/src/api/engine/remote/ws/wasm.rs b/sdk/src/api/engine/remote/ws/wasm.rs similarity index 100% rename from lib/src/api/engine/remote/ws/wasm.rs rename to sdk/src/api/engine/remote/ws/wasm.rs diff --git a/lib/src/api/engine/tasks.rs b/sdk/src/api/engine/tasks.rs similarity index 100% rename from lib/src/api/engine/tasks.rs rename to sdk/src/api/engine/tasks.rs diff --git a/lib/src/api/err/mod.rs b/sdk/src/api/err/mod.rs similarity index 100% rename from lib/src/api/err/mod.rs rename to sdk/src/api/err/mod.rs diff --git a/lib/src/api/headers/mod.rs b/sdk/src/api/headers/mod.rs similarity index 100% rename from lib/src/api/headers/mod.rs rename to sdk/src/api/headers/mod.rs diff --git a/lib/src/api/method/authenticate.rs b/sdk/src/api/method/authenticate.rs similarity index 100% rename from lib/src/api/method/authenticate.rs rename to sdk/src/api/method/authenticate.rs diff --git a/lib/src/api/method/begin.rs b/sdk/src/api/method/begin.rs similarity index 100% rename from lib/src/api/method/begin.rs rename to sdk/src/api/method/begin.rs diff --git a/lib/src/api/method/cancel.rs b/sdk/src/api/method/cancel.rs similarity index 100% rename from lib/src/api/method/cancel.rs rename to sdk/src/api/method/cancel.rs diff --git a/lib/src/api/method/commit.rs b/sdk/src/api/method/commit.rs similarity index 100% rename from lib/src/api/method/commit.rs rename to sdk/src/api/method/commit.rs diff --git a/lib/src/api/method/content.rs b/sdk/src/api/method/content.rs similarity index 100% rename from lib/src/api/method/content.rs rename to sdk/src/api/method/content.rs diff --git a/lib/src/api/method/create.rs b/sdk/src/api/method/create.rs similarity index 100% rename from lib/src/api/method/create.rs rename to sdk/src/api/method/create.rs diff --git a/lib/src/api/method/delete.rs b/sdk/src/api/method/delete.rs similarity index 100% rename from lib/src/api/method/delete.rs rename to sdk/src/api/method/delete.rs diff --git a/lib/src/api/method/export.rs b/sdk/src/api/method/export.rs similarity index 100% rename from lib/src/api/method/export.rs rename to sdk/src/api/method/export.rs diff --git a/lib/src/api/method/health.rs b/sdk/src/api/method/health.rs similarity index 100% rename from lib/src/api/method/health.rs rename to sdk/src/api/method/health.rs diff --git a/lib/src/api/method/import.rs b/sdk/src/api/method/import.rs similarity index 100% rename from lib/src/api/method/import.rs rename to sdk/src/api/method/import.rs diff --git a/lib/src/api/method/insert.rs b/sdk/src/api/method/insert.rs similarity index 100% rename from lib/src/api/method/insert.rs rename to sdk/src/api/method/insert.rs diff --git a/lib/src/api/method/invalidate.rs b/sdk/src/api/method/invalidate.rs similarity index 100% rename from lib/src/api/method/invalidate.rs rename to sdk/src/api/method/invalidate.rs diff --git a/lib/src/api/method/live.rs b/sdk/src/api/method/live.rs similarity index 100% rename from lib/src/api/method/live.rs rename to sdk/src/api/method/live.rs diff --git a/lib/src/api/method/merge.rs b/sdk/src/api/method/merge.rs similarity index 100% rename from lib/src/api/method/merge.rs rename to sdk/src/api/method/merge.rs diff --git a/lib/src/api/method/mod.rs b/sdk/src/api/method/mod.rs similarity index 100% rename from lib/src/api/method/mod.rs rename to sdk/src/api/method/mod.rs diff --git a/lib/src/api/method/patch.rs b/sdk/src/api/method/patch.rs similarity index 100% rename from lib/src/api/method/patch.rs rename to sdk/src/api/method/patch.rs diff --git a/lib/src/api/method/query.rs b/sdk/src/api/method/query.rs similarity index 100% rename from lib/src/api/method/query.rs rename to sdk/src/api/method/query.rs diff --git a/lib/src/api/method/run.rs b/sdk/src/api/method/run.rs similarity index 100% rename from lib/src/api/method/run.rs rename to sdk/src/api/method/run.rs diff --git a/lib/src/api/method/select.rs b/sdk/src/api/method/select.rs similarity index 100% rename from lib/src/api/method/select.rs rename to sdk/src/api/method/select.rs diff --git a/lib/src/api/method/set.rs b/sdk/src/api/method/set.rs similarity index 100% rename from lib/src/api/method/set.rs rename to sdk/src/api/method/set.rs diff --git a/lib/src/api/method/signin.rs b/sdk/src/api/method/signin.rs similarity index 100% rename from lib/src/api/method/signin.rs rename to sdk/src/api/method/signin.rs diff --git a/lib/src/api/method/signup.rs b/sdk/src/api/method/signup.rs similarity index 100% rename from lib/src/api/method/signup.rs rename to sdk/src/api/method/signup.rs diff --git a/lib/src/api/method/tests/mod.rs b/sdk/src/api/method/tests/mod.rs similarity index 100% rename from lib/src/api/method/tests/mod.rs rename to sdk/src/api/method/tests/mod.rs diff --git a/lib/src/api/method/tests/protocol.rs b/sdk/src/api/method/tests/protocol.rs similarity index 100% rename from lib/src/api/method/tests/protocol.rs rename to sdk/src/api/method/tests/protocol.rs diff --git a/lib/src/api/method/tests/server.rs b/sdk/src/api/method/tests/server.rs similarity index 100% rename from lib/src/api/method/tests/server.rs rename to sdk/src/api/method/tests/server.rs diff --git a/lib/src/api/method/tests/types.rs b/sdk/src/api/method/tests/types.rs similarity index 100% rename from lib/src/api/method/tests/types.rs rename to sdk/src/api/method/tests/types.rs diff --git a/lib/src/api/method/unset.rs b/sdk/src/api/method/unset.rs similarity index 100% rename from lib/src/api/method/unset.rs rename to sdk/src/api/method/unset.rs diff --git a/lib/src/api/method/update.rs b/sdk/src/api/method/update.rs similarity index 100% rename from lib/src/api/method/update.rs rename to sdk/src/api/method/update.rs diff --git a/lib/src/api/method/upsert.rs b/sdk/src/api/method/upsert.rs similarity index 100% rename from lib/src/api/method/upsert.rs rename to sdk/src/api/method/upsert.rs diff --git a/lib/src/api/method/use_db.rs b/sdk/src/api/method/use_db.rs similarity index 100% rename from lib/src/api/method/use_db.rs rename to sdk/src/api/method/use_db.rs diff --git a/lib/src/api/method/use_ns.rs b/sdk/src/api/method/use_ns.rs similarity index 100% rename from lib/src/api/method/use_ns.rs rename to sdk/src/api/method/use_ns.rs diff --git a/lib/src/api/method/version.rs b/sdk/src/api/method/version.rs similarity index 100% rename from lib/src/api/method/version.rs rename to sdk/src/api/method/version.rs diff --git a/lib/src/api/mod.rs b/sdk/src/api/mod.rs similarity index 100% rename from lib/src/api/mod.rs rename to sdk/src/api/mod.rs diff --git a/lib/src/api/opt/auth.rs b/sdk/src/api/opt/auth.rs similarity index 100% rename from lib/src/api/opt/auth.rs rename to sdk/src/api/opt/auth.rs diff --git a/lib/src/api/opt/capabilities.rs b/sdk/src/api/opt/capabilities.rs similarity index 100% rename from lib/src/api/opt/capabilities.rs rename to sdk/src/api/opt/capabilities.rs diff --git a/lib/src/api/opt/config.rs b/sdk/src/api/opt/config.rs similarity index 100% rename from lib/src/api/opt/config.rs rename to sdk/src/api/opt/config.rs diff --git a/lib/src/api/opt/endpoint/fdb.rs b/sdk/src/api/opt/endpoint/fdb.rs similarity index 100% rename from lib/src/api/opt/endpoint/fdb.rs rename to sdk/src/api/opt/endpoint/fdb.rs diff --git a/lib/src/api/opt/endpoint/http.rs b/sdk/src/api/opt/endpoint/http.rs similarity index 100% rename from lib/src/api/opt/endpoint/http.rs rename to sdk/src/api/opt/endpoint/http.rs diff --git a/lib/src/api/opt/endpoint/indxdb.rs b/sdk/src/api/opt/endpoint/indxdb.rs similarity index 100% rename from lib/src/api/opt/endpoint/indxdb.rs rename to sdk/src/api/opt/endpoint/indxdb.rs diff --git a/lib/src/api/opt/endpoint/mem.rs b/sdk/src/api/opt/endpoint/mem.rs similarity index 100% rename from lib/src/api/opt/endpoint/mem.rs rename to sdk/src/api/opt/endpoint/mem.rs diff --git a/lib/src/api/opt/endpoint/mod.rs b/sdk/src/api/opt/endpoint/mod.rs similarity index 100% rename from lib/src/api/opt/endpoint/mod.rs rename to sdk/src/api/opt/endpoint/mod.rs diff --git a/lib/src/api/opt/endpoint/rocksdb.rs b/sdk/src/api/opt/endpoint/rocksdb.rs similarity index 100% rename from lib/src/api/opt/endpoint/rocksdb.rs rename to sdk/src/api/opt/endpoint/rocksdb.rs diff --git a/lib/src/api/opt/endpoint/surrealkv.rs b/sdk/src/api/opt/endpoint/surrealkv.rs similarity index 100% rename from lib/src/api/opt/endpoint/surrealkv.rs rename to sdk/src/api/opt/endpoint/surrealkv.rs diff --git a/lib/src/api/opt/endpoint/tikv.rs b/sdk/src/api/opt/endpoint/tikv.rs similarity index 100% rename from lib/src/api/opt/endpoint/tikv.rs rename to sdk/src/api/opt/endpoint/tikv.rs diff --git a/lib/src/api/opt/endpoint/ws.rs b/sdk/src/api/opt/endpoint/ws.rs similarity index 100% rename from lib/src/api/opt/endpoint/ws.rs rename to sdk/src/api/opt/endpoint/ws.rs diff --git a/lib/src/api/opt/export.rs b/sdk/src/api/opt/export.rs similarity index 100% rename from lib/src/api/opt/export.rs rename to sdk/src/api/opt/export.rs diff --git a/lib/src/api/opt/mod.rs b/sdk/src/api/opt/mod.rs similarity index 100% rename from lib/src/api/opt/mod.rs rename to sdk/src/api/opt/mod.rs diff --git a/lib/src/api/opt/query.rs b/sdk/src/api/opt/query.rs similarity index 100% rename from lib/src/api/opt/query.rs rename to sdk/src/api/opt/query.rs diff --git a/lib/src/api/opt/resource.rs b/sdk/src/api/opt/resource.rs similarity index 100% rename from lib/src/api/opt/resource.rs rename to sdk/src/api/opt/resource.rs diff --git a/lib/src/api/opt/tls.rs b/sdk/src/api/opt/tls.rs similarity index 100% rename from lib/src/api/opt/tls.rs rename to sdk/src/api/opt/tls.rs diff --git a/lib/src/api/value/core.rs b/sdk/src/api/value/core.rs similarity index 100% rename from lib/src/api/value/core.rs rename to sdk/src/api/value/core.rs diff --git a/lib/src/api/value/mod.rs b/sdk/src/api/value/mod.rs similarity index 100% rename from lib/src/api/value/mod.rs rename to sdk/src/api/value/mod.rs diff --git a/lib/src/api/value/obj.rs b/sdk/src/api/value/obj.rs similarity index 100% rename from lib/src/api/value/obj.rs rename to sdk/src/api/value/obj.rs diff --git a/lib/src/lib.rs b/sdk/src/lib.rs similarity index 100% rename from lib/src/lib.rs rename to sdk/src/lib.rs diff --git a/lib/src/mac/mod.rs b/sdk/src/mac/mod.rs similarity index 100% rename from lib/src/mac/mod.rs rename to sdk/src/mac/mod.rs diff --git a/lib/tests/access.rs b/sdk/tests/access.rs similarity index 100% rename from lib/tests/access.rs rename to sdk/tests/access.rs diff --git a/lib/tests/alter.rs b/sdk/tests/alter.rs similarity index 100% rename from lib/tests/alter.rs rename to sdk/tests/alter.rs diff --git a/lib/tests/api.rs b/sdk/tests/api.rs similarity index 100% rename from lib/tests/api.rs rename to sdk/tests/api.rs diff --git a/lib/tests/api/backup.rs b/sdk/tests/api/backup.rs similarity index 100% rename from lib/tests/api/backup.rs rename to sdk/tests/api/backup.rs diff --git a/lib/tests/api/live.rs b/sdk/tests/api/live.rs similarity index 100% rename from lib/tests/api/live.rs rename to sdk/tests/api/live.rs diff --git a/lib/tests/api/mod.rs b/sdk/tests/api/mod.rs similarity index 100% rename from lib/tests/api/mod.rs rename to sdk/tests/api/mod.rs diff --git a/lib/tests/cache.rs b/sdk/tests/cache.rs similarity index 100% rename from lib/tests/cache.rs rename to sdk/tests/cache.rs diff --git a/lib/tests/cast.rs b/sdk/tests/cast.rs similarity index 100% rename from lib/tests/cast.rs rename to sdk/tests/cast.rs diff --git a/lib/tests/changefeeds.rs b/sdk/tests/changefeeds.rs similarity index 100% rename from lib/tests/changefeeds.rs rename to sdk/tests/changefeeds.rs diff --git a/lib/tests/closure.rs b/sdk/tests/closure.rs similarity index 100% rename from lib/tests/closure.rs rename to sdk/tests/closure.rs diff --git a/lib/tests/compare.rs b/sdk/tests/compare.rs similarity index 100% rename from lib/tests/compare.rs rename to sdk/tests/compare.rs diff --git a/lib/tests/complex.rs b/sdk/tests/complex.rs similarity index 100% rename from lib/tests/complex.rs rename to sdk/tests/complex.rs diff --git a/lib/tests/create.rs b/sdk/tests/create.rs similarity index 100% rename from lib/tests/create.rs rename to sdk/tests/create.rs diff --git a/lib/tests/datetimes.rs b/sdk/tests/datetimes.rs similarity index 100% rename from lib/tests/datetimes.rs rename to sdk/tests/datetimes.rs diff --git a/lib/tests/define.rs b/sdk/tests/define.rs similarity index 100% rename from lib/tests/define.rs rename to sdk/tests/define.rs diff --git a/lib/tests/delete.rs b/sdk/tests/delete.rs similarity index 100% rename from lib/tests/delete.rs rename to sdk/tests/delete.rs diff --git a/lib/tests/escape.rs b/sdk/tests/escape.rs similarity index 100% rename from lib/tests/escape.rs rename to sdk/tests/escape.rs diff --git a/lib/tests/expression.rs b/sdk/tests/expression.rs similarity index 100% rename from lib/tests/expression.rs rename to sdk/tests/expression.rs diff --git a/lib/tests/fetch.rs b/sdk/tests/fetch.rs similarity index 100% rename from lib/tests/fetch.rs rename to sdk/tests/fetch.rs diff --git a/lib/tests/field.rs b/sdk/tests/field.rs similarity index 100% rename from lib/tests/field.rs rename to sdk/tests/field.rs diff --git a/lib/tests/foreach.rs b/sdk/tests/foreach.rs similarity index 100% rename from lib/tests/foreach.rs rename to sdk/tests/foreach.rs diff --git a/lib/tests/function.rs b/sdk/tests/function.rs similarity index 100% rename from lib/tests/function.rs rename to sdk/tests/function.rs diff --git a/lib/tests/future.rs b/sdk/tests/future.rs similarity index 100% rename from lib/tests/future.rs rename to sdk/tests/future.rs diff --git a/lib/tests/geometry.rs b/sdk/tests/geometry.rs similarity index 100% rename from lib/tests/geometry.rs rename to sdk/tests/geometry.rs diff --git a/lib/tests/group.rs b/sdk/tests/group.rs similarity index 100% rename from lib/tests/group.rs rename to sdk/tests/group.rs diff --git a/lib/tests/helpers.rs b/sdk/tests/helpers.rs similarity index 100% rename from lib/tests/helpers.rs rename to sdk/tests/helpers.rs diff --git a/lib/tests/idiom.rs b/sdk/tests/idiom.rs similarity index 100% rename from lib/tests/idiom.rs rename to sdk/tests/idiom.rs diff --git a/lib/tests/info.rs b/sdk/tests/info.rs similarity index 100% rename from lib/tests/info.rs rename to sdk/tests/info.rs diff --git a/lib/tests/insert.rs b/sdk/tests/insert.rs similarity index 100% rename from lib/tests/insert.rs rename to sdk/tests/insert.rs diff --git a/lib/tests/matches.rs b/sdk/tests/matches.rs similarity index 100% rename from lib/tests/matches.rs rename to sdk/tests/matches.rs diff --git a/lib/tests/merge.rs b/sdk/tests/merge.rs similarity index 100% rename from lib/tests/merge.rs rename to sdk/tests/merge.rs diff --git a/lib/tests/model.rs b/sdk/tests/model.rs similarity index 100% rename from lib/tests/model.rs rename to sdk/tests/model.rs diff --git a/lib/tests/option.rs b/sdk/tests/option.rs similarity index 100% rename from lib/tests/option.rs rename to sdk/tests/option.rs diff --git a/lib/tests/param.rs b/sdk/tests/param.rs similarity index 100% rename from lib/tests/param.rs rename to sdk/tests/param.rs diff --git a/lib/tests/parse.rs b/sdk/tests/parse.rs similarity index 100% rename from lib/tests/parse.rs rename to sdk/tests/parse.rs diff --git a/lib/tests/planner.rs b/sdk/tests/planner.rs similarity index 100% rename from lib/tests/planner.rs rename to sdk/tests/planner.rs diff --git a/lib/tests/query.rs b/sdk/tests/query.rs similarity index 100% rename from lib/tests/query.rs rename to sdk/tests/query.rs diff --git a/lib/tests/range.rs b/sdk/tests/range.rs similarity index 100% rename from lib/tests/range.rs rename to sdk/tests/range.rs diff --git a/lib/tests/rebuild.rs b/sdk/tests/rebuild.rs similarity index 100% rename from lib/tests/rebuild.rs rename to sdk/tests/rebuild.rs diff --git a/lib/tests/relate.rs b/sdk/tests/relate.rs similarity index 100% rename from lib/tests/relate.rs rename to sdk/tests/relate.rs diff --git a/lib/tests/remove.rs b/sdk/tests/remove.rs similarity index 100% rename from lib/tests/remove.rs rename to sdk/tests/remove.rs diff --git a/lib/tests/return.rs b/sdk/tests/return.rs similarity index 100% rename from lib/tests/return.rs rename to sdk/tests/return.rs diff --git a/lib/tests/running.md b/sdk/tests/running.md similarity index 100% rename from lib/tests/running.md rename to sdk/tests/running.md diff --git a/lib/tests/script.rs b/sdk/tests/script.rs similarity index 100% rename from lib/tests/script.rs rename to sdk/tests/script.rs diff --git a/lib/tests/select.rs b/sdk/tests/select.rs similarity index 100% rename from lib/tests/select.rs rename to sdk/tests/select.rs diff --git a/lib/tests/set.rs b/sdk/tests/set.rs similarity index 100% rename from lib/tests/set.rs rename to sdk/tests/set.rs diff --git a/lib/tests/strict.rs b/sdk/tests/strict.rs similarity index 100% rename from lib/tests/strict.rs rename to sdk/tests/strict.rs diff --git a/lib/tests/subquery.rs b/sdk/tests/subquery.rs similarity index 100% rename from lib/tests/subquery.rs rename to sdk/tests/subquery.rs diff --git a/lib/tests/table.rs b/sdk/tests/table.rs similarity index 100% rename from lib/tests/table.rs rename to sdk/tests/table.rs diff --git a/lib/tests/throw.rs b/sdk/tests/throw.rs similarity index 100% rename from lib/tests/throw.rs rename to sdk/tests/throw.rs diff --git a/lib/tests/transaction.rs b/sdk/tests/transaction.rs similarity index 100% rename from lib/tests/transaction.rs rename to sdk/tests/transaction.rs diff --git a/lib/tests/typing.rs b/sdk/tests/typing.rs similarity index 100% rename from lib/tests/typing.rs rename to sdk/tests/typing.rs diff --git a/lib/tests/update.rs b/sdk/tests/update.rs similarity index 100% rename from lib/tests/update.rs rename to sdk/tests/update.rs diff --git a/lib/tests/upsert.rs b/sdk/tests/upsert.rs similarity index 100% rename from lib/tests/upsert.rs rename to sdk/tests/upsert.rs diff --git a/lib/tests/util.rs b/sdk/tests/util.rs similarity index 100% rename from lib/tests/util.rs rename to sdk/tests/util.rs diff --git a/lib/tests/vector.rs b/sdk/tests/vector.rs similarity index 100% rename from lib/tests/vector.rs rename to sdk/tests/vector.rs diff --git a/lib/tests/yuse.rs b/sdk/tests/yuse.rs similarity index 100% rename from lib/tests/yuse.rs rename to sdk/tests/yuse.rs diff --git a/tests/README.md b/tests/README.md index 2b1d1fcf7216..8b46207f2e13 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,6 +1,6 @@ This folder contains integration tests for the `surreal` CLI binary. -See [`lib/tests`](../lib/tests/) for `surrealdb` library integration tests. +See [`sdk/tests`](../sdk/tests/) for `surrealdb` library integration tests. To read server log output from these tests, you need to find the file containing the output. You can find this file by setting `RUST_LOG=debug`. diff --git a/tests/sdk/local/Cargo.toml b/tests/sdk/local/Cargo.toml index 8e234eea4124..cab97cd3abd5 100644 --- a/tests/sdk/local/Cargo.toml +++ b/tests/sdk/local/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2021" [dependencies] -surrealdb = { path = "../../../lib", features = ["kv-mem"] } +surrealdb = { path = "../../../sdk", features = ["kv-mem"] } tokio = { version = "1", features = ["full"] } [workspace] diff --git a/tests/sdk/remote/Cargo.toml b/tests/sdk/remote/Cargo.toml index 692558dd309a..b7df58cfe27c 100644 --- a/tests/sdk/remote/Cargo.toml +++ b/tests/sdk/remote/Cargo.toml @@ -4,7 +4,7 @@ version = "1.0.0" edition = "2021" [dependencies] -surrealdb = { path = "../../../lib" } +surrealdb = { path = "../../../sdk" } tokio = { version = "1", features = ["full"] } [workspace]