diff --git a/CHANGELOG.md b/CHANGELOG.md index e6431ba..c8364d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [0.0.3] - 2023-07-30 ### Fixed - `.update()` request sends correct request type. @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `ConnectionLike` now `Send` and `Sync`. -## [0.2.0] - 2023-05-18 +## [0.0.3] - 2023-05-18 ### Added - `indices` method to `SpaceMetadata` for accessing space's indices; - `get_by_name` and `get_by_id` methods to `UniqueIdNameMap`; diff --git a/Cargo.toml b/Cargo.toml index 174e471..fdf5f98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tarantool-rs" description = "Asyncronous tokio-based client for Tarantool" -version = "0.0.2" +version = "0.0.3" edition = "2021" authors = ["Andrey Kononov flowneee3@gmail.com"] license = "MIT" diff --git a/src/client/connection_like.rs b/src/client/connection_like.rs index d5ef454..e4dfd10 100644 --- a/src/client/connection_like.rs +++ b/src/client/connection_like.rs @@ -14,7 +14,6 @@ use crate::{ }, utils::deserialize_non_sql_response, }, - schema::Space, IteratorType, Result, }; diff --git a/tests/integration.rs b/tests/integration.rs index b11849a..4bebcc8 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -3,7 +3,7 @@ extern crate rental; use assert_matches::assert_matches; use serde::Deserialize; -use tarantool_rs::{errors::Error, schema::SpaceMetadata, Connection, ConnectionLike}; +use tarantool_rs::{errors::Error, Connection, ConnectionLike}; use crate::common::TarantoolTestContainer; @@ -83,13 +83,17 @@ async fn retrieve_schema() -> Result<(), anyhow::Error> { let conn = container.create_conn().await?; let space = conn - .load_by_name("ds9_crew") + .find_space_by_name("ds9_crew") .await? .expect("Space 'ds9_crew' found"); - assert_eq!(space.id(), 512, "First user space expected to have id 512"); - assert_eq!(space.name(), "ds9_crew"); + assert_eq!( + space.metadata().id(), + 512, + "First user space expected to have id 512" + ); + assert_eq!(space.metadata().name(), "ds9_crew"); - assert_eq!(space.indices().len(), 3); + assert_eq!(space.metadata().indices().len(), 3); let primary_idx = space .metadata() .indices() @@ -107,14 +111,18 @@ async fn select_all() -> Result<(), anyhow::Error> { let container = TarantoolTestContainer::default(); let conn: Connection = container.create_conn().await?; - let space = SpaceMetadata::load_by_name(&conn, "ds9_crew") + let space = conn + .find_space_by_name("ds9_crew") .await? .expect("Space 'ds9_crew' found"); - let primary_idx = space.indices().get_by_id(0).expect("Primary index present"); + let primary_idx = space + .metadata() + .indices() + .get_by_id(0) + .expect("Primary index present"); - let members: Vec = conn + let members: Vec = space .select( - space.id(), primary_idx.id(), None, None, @@ -141,14 +149,18 @@ async fn select_limits() -> Result<(), anyhow::Error> { let container = TarantoolTestContainer::default(); let conn: Connection = container.create_conn().await?; - let space = SpaceMetadata::load_by_name(&conn, "ds9_crew") + let space = conn + .find_space_by_name("ds9_crew") .await? .expect("Space 'ds9_crew' found"); - let primary_idx = space.indices().get_by_id(0).expect("Primary index present"); + let primary_idx = space + .metadata() + .indices() + .get_by_id(0) + .expect("Primary index present"); - let members: Vec = conn + let members: Vec = space .select( - space.id(), primary_idx.id(), Some(2), Some(2), @@ -175,17 +187,18 @@ async fn select_by_key() -> Result<(), anyhow::Error> { let container = TarantoolTestContainer::default(); let conn: Connection = container.create_conn().await?; - let space = SpaceMetadata::load_by_name(&conn, "ds9_crew") + let space = conn + .find_space_by_name("ds9_crew") .await? .expect("Space 'ds9_crew' found"); let rank_idx = space + .metadata() .indices() .get_by_name("idx_rank") .expect("Rank index present"); - let members: Vec = conn + let members: Vec = space .select( - space.id(), rank_idx.id(), None, None,