Skip to content

Commit

Permalink
Release 0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowneee committed Jul 30, 2023
1 parent a322ea1 commit 1fb782c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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`;
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 [email protected]"]
license = "MIT"
Expand Down
1 change: 0 additions & 1 deletion src/client/connection_like.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::{
},
utils::deserialize_non_sql_response,
},
schema::Space,
IteratorType, Result,
};

Expand Down
45 changes: 29 additions & 16 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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()
Expand All @@ -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<CrewMember> = conn
let members: Vec<CrewMember> = space
.select(
space.id(),
primary_idx.id(),
None,
None,
Expand All @@ -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<CrewMember> = conn
let members: Vec<CrewMember> = space
.select(
space.id(),
primary_idx.id(),
Some(2),
Some(2),
Expand All @@ -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<CrewMember> = conn
let members: Vec<CrewMember> = space
.select(
space.id(),
rank_idx.id(),
None,
None,
Expand Down

0 comments on commit 1fb782c

Please sign in to comment.