Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowneee committed May 14, 2023
1 parent bdb85ee commit 2273b3a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 48 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ All notable changes to this project will be documented in this file.
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.1] - 2023-05-15
### Added
- Initial implementation.
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.0"
version = "0.0.1"
edition = "2021"
authors = ["Andrey Kononov [email protected]"]
license = "MIT"
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# `tarantool-rs` - Asyncronous tokio-based client for Tarantool
# `tarantool-rs` - Asyncronous Tokio-based client for Tarantool (WIP)

![CI](https://github.com/Flowneee/tarantool-rs/actions/workflows/ci.yml/badge.svg)

`tarantool-rs` - asyncronous Tokio-based client for [Tarantool](https://www.tarantool.io).

For examples of how to use this crate check `examples/` folder.

## Features

* [x] authorization;
* [x] evaluating Lua expressions)
* [x] function calling)
* [x] select from spaces
* [x] "DML" requests (insert/update/upsert/replace/delete)
* [x] transaction control (begin/commit/rollback)
* [ ] SQL requests
* [ ] chunked responses
* [ ] reconnection in background
* [ ] connection pooling
* [ ] automatic schema fetching and reloading
* [ ] ...


1 change: 0 additions & 1 deletion examples/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ async fn main() -> Result<(), anyhow::Error> {

let conn = Connection::builder().build("127.0.0.1:3301").await?;

//let data = get_list_of_user_spaces(&conn).await?;
let data = SpaceMetadata::load_by_name(conn, "clients").await?;
info!("{:?}", data);

Expand Down
44 changes: 0 additions & 44 deletions examples/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,5 @@ async fn main() -> Result<(), anyhow::Error> {
vec![1.into()],
)
.await?;

// let eval_fut = connection
// .eval::<_, (u32, String)>(
// "fiber = require('fiber'); fiber.sleep(0.5); return ...;",
// vec![42.into(), "pong".into()],
// )
// .inspect(|res| info!("Eval response: {:?}", res));
// let call_fut = connection
// .call::<_, (String,)>("tostring", vec![42.into()])
// .inspect(|res| info!("Call response: {:?}", res));
// let ping_fut = connection
// .ping()
// .inspect(|res| info!("Ping response: {:?}", res));
// let _ = tokio::join!(eval_fut, call_fut, ping_fut);

// let stream = connection.stream();
// let eval_fut = stream
// .eval::<_, (u32, String)>(
// "fiber = require('fiber'); fiber.sleep(0.5); return ...;",
// vec![42.into(), "pong".into()],
// )
// .inspect(|res| info!("Eval response: {:?}", res));
// let call_fut = stream
// .call::<_, (String,)>("tostring", vec![42.into()])
// .inspect(|res| info!("Call response: {:?}", res));
// let ping_fut = stream
// .ping()
// .inspect(|res| info!("Ping response: {:?}", res));
// let _ = tokio::join!(eval_fut, call_fut, ping_fut);

// let transaction = connection.transaction().await.unwrap();
// let eval_fut = transaction
// .eval::<_, (u32, String)>(
// "fiber = require('fiber'); fiber.sleep(0.5); return ...;",
// vec![42.into(), "pong".into()],
// )
// .inspect(|res| info!("Eval response: {:?}", res));
// let call_fut = transaction
// .call::<_, (String,)>("tostring", vec![42.into()])
// .inspect(|res| info!("Call response: {:?}", res));
// let ping_fut = transaction
// .ping()
// .inspect(|res| info!("Ping response: {:?}", res));
// let _ = tokio::join!(eval_fut, call_fut, ping_fut);
Ok(())
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// * [ ] streaming responses for select
// * [ ] background schema fetching, reloading and invalidating
// * [ ] triggers on connection events (connect/disconnect/schema reloading)
// * [ ] SQL
//
// Other
//
Expand Down

0 comments on commit 2273b3a

Please sign in to comment.