Crates.io | rusty_tarantool |
lib.rs | rusty_tarantool |
version | 0.2.11 |
source | src |
created_at | 2018-09-01 09:10:59.234663 |
updated_at | 2022-12-05 09:23:03.61835 |
description | Tarantul async client based on tokio framework |
homepage | |
repository | https://github.com/zheludkovm/RustyTarantool |
max_upload_size | |
id | 82454 |
size | 140,704 |
Ported java connector to tarantool db
https://github.com/tarantool/tarantool-java
Use tokio.io as base client framework
Call echo stored procedure
run tarantool
cd test-tarantool;tarantool init-tarantool.lua
Lua stored procedure:
function test(a,b)
return a,b,11
end
Rust client :
println!("Connect to tarantool and call simple stored procedure!");
let client = ClientConfig::new("127.0.0.1:3301", "rust", "rust")
.set_timeout_time_ms(2000)
.set_reconnect_time_ms(2000)
.build();
let response = client
.prepare_fn_call("test")
.bind_ref(&("aa", "aa"))?
.bind(1)?
.execute().await?;
let res: ((String,String), u64) = response.decode_pair()?;
println!("stored procedure response ={:?}", res);
let response_sql = client
.prepare_sql("select * from TABLE1 where COLUMN1=?")
.bind(1)?
.execute().await?;
let meta = response.metadata();
let rows: Vec<(u32, String)> = response.decode_result_set()?;
println!("resp value={:?}", row);
Output :
Connect to tarantool and call simple stored procedure!
stored procedure response =(("param11", "param12"), (2,), (Some(11),))
On examples part of project you can also see more complicated examples :
hyper http server connecting to tarantool
actix-web example
simple benchmark