All Projects → LooMaclin → tarantool_rs

LooMaclin / tarantool_rs

Licence: GPL-3.0 License
Sync/Async tarantool database connector. WORK IN PROGRESS. DON'T SHARE THIS REPO

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to tarantool rs

tarantool.ex
Tarantool client library for Elixir projects
Stars: ✭ 26 (+85.71%)
Mutual labels:  connector, driver, tarantool
Yubihsm Go
A Go client for the yubihsm2 binary protocol and connector service
Stars: ✭ 19 (+35.71%)
Mutual labels:  connector, driver
Monstache
a go daemon that syncs MongoDB to Elasticsearch in realtime
Stars: ✭ 736 (+5157.14%)
Mutual labels:  sync, connector
tarantool-php
PECL PHP driver for Tarantool
Stars: ✭ 82 (+485.71%)
Mutual labels:  driver, tarantool
reinforced-race
A model car learns driving along a track using reinforcement learning
Stars: ✭ 37 (+164.29%)
Mutual labels:  driver
ring-election
A node js library with a distributed leader/follower algorithm ready to be used
Stars: ✭ 92 (+557.14%)
Mutual labels:  driver
pwm-pca9685-rs
Platform-agnostic Rust driver for the PCA9685 I2C 16-channel, 12-bit PWM/Servo/LED controller
Stars: ✭ 19 (+35.71%)
Mutual labels:  driver
tn40xx-driver
Linux driver for tn40xx from Tehuti Networks
Stars: ✭ 53 (+278.57%)
Mutual labels:  driver
Cat-Driver
CatDriver - The Kernel Mode Driver that written in C++. It is an useful driver and has the highest privilege level on the Windows platform. It can be used for Game Hacking and others.
Stars: ✭ 41 (+192.86%)
Mutual labels:  driver
tarantool-module
Tarantool Rust SDK
Stars: ✭ 24 (+71.43%)
Mutual labels:  tarantool
pps-gen-gpio
Linux kernel PPS generator using GPIO pins
Stars: ✭ 25 (+78.57%)
Mutual labels:  driver
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (+14.29%)
Mutual labels:  sync
tarantool-admin
No description or website provided.
Stars: ✭ 90 (+542.86%)
Mutual labels:  tarantool
laravel-scout-mysql
A MySql Engine for Laravel Scout
Stars: ✭ 25 (+78.57%)
Mutual labels:  driver
tsdav
WebDAV, CALDAV, and CARDDAV client for Nodejs and the Browser
Stars: ✭ 33 (+135.71%)
Mutual labels:  sync
tuya-connector
tuya-connector helps you efficiently create cloud development projects regarding the OpenAPI or message subscription capabilities. You can put all the focus on business logic without taking care of server-side programming nor relational databases.
Stars: ✭ 28 (+100%)
Mutual labels:  connector
docker base images
Vlad's Base Images for Docker
Stars: ✭ 61 (+335.71%)
Mutual labels:  sync
arduino-sht
Repository for Sensirion humidity and temperature sensor support on Arduino
Stars: ✭ 43 (+207.14%)
Mutual labels:  driver
pearlfan
GNU/Linux kernel driver and libusb app for a Pearl's USB LED fan
Stars: ✭ 20 (+42.86%)
Mutual labels:  driver
atom-package-sync
Synchronize your atom packages and settings easily
Stars: ✭ 22 (+57.14%)
Mutual labels:  sync

tarantool_rs

Sync/Async tarantool database connector.

Build Status

Coverage Status

Overview

Install

[dependencies]
tarantool = { git = "https://github.com/LooMaclin/tarantool_rs.git" }

Usage

Include extern crate

extern crate tarantool;

Use modules

use tarantool::{Value, Tarantool, IteratorType, Select, Insert, Replace, Delete, UpdateCommon,
                CommonOperation, Call, Eval, UpdateString, UpdateInteger, IntegerOperation, Upsert,
                UpsertOperation};

Create tarantool connection instance

    let mut tarantool_instance = Tarantool::auth("127.0.0.1:3301", "test", "test").unwrap_or_else(|err| {
        panic!("err: {}", err);
    });

    let error_handler = |err| panic!(SyncClient, err);

Retrieve space id

    let space_id = tarantool_instance.fetch_space_id("tester");
    debug!("Tester space id: {}", space_id);

Retrieve index id

    let index_id = tarantool_instance.fetch_index_id(space_id, "primary");
    debug!("Tester primary index id: {}", index_id);

Select

    let select = Select {
        space: 512,
        index: 0,
        limit: 100,
        offset: 0,
        iterator: IteratorType::All,
        keys: &vec![]
    };

    let tuples = tarantool_instance.request(&select).unwrap_or_else(&error_handler);

    debug!("Select result: ");
    for (index, tuple) in tuples.as_array().unwrap().iter().enumerate() {
        let tuple = tuple.as_array().unwrap();
        debug!("{}: {:?}", index, tuple);
    }
    

Insert

    let insert = Insert {
        space: 512,
        keys: &vec![Value::from(9)]
    };

    debug!("Insert result: {:?}", tarantool_instance.request(&insert).unwrap_or_else(&error_handler));

Replace

    let replace = Replace {
        space: 512,
        keys: &vec![Value::from(1), Value::String(String::from("TEST REPLACE"))]
    };

    debug!("Replace result: {:?}", tarantool_instance.request(&replace).unwrap_or_else(&error_handler));

Update integer

    let update_integer = UpdateInteger {
        space: 512,
        index: 0,
        operation_type: IntegerOperation::Addition,
        field_number: 2,
        argument: 1,
        keys: &vec![Value::from(4)]
    };

    debug!("Integer-Update result: {:?}", tarantool_instance.request(&update_integer).unwrap_or_else(&error_handler));

Update string

    let update_string = UpdateString {
        space: 512,
        index: 0,
        field_number: 1,
        position: 3,
        offset: 3,
        argument: "TEST UPDATE STRING".into(),
        keys: &vec![Value::from(2)]
    };

    debug!("String-Update result: {:?}", tarantool_instance.request(&update_string).unwrap_or_else(&error_handler));

Update common

    let update_common = UpdateCommon {
        space: 512,
        index: 0,
        operation_type: CommonOperation::Assign,
        field_number: 3,
        argument: Value::String(String::from("Test Update Common Assign")),
        keys: &vec![Value::from(6)]
    };

    debug!("Common-Update result: {:?}", tarantool_instance.request(&update_common).unwrap_or_else(&error_handler));

Delete

    let delete = Delete {
        space: 512,
        index: 0,
        keys: &vec![Value::from(3)]
    };

    debug!("Delete result: {:?}", tarantool_instance.request(&delete).unwrap_or_else(&error_handler));

Call

    let call = Call {
        function_name: "test",
        keys: &vec![]
    };

    debug!("Call result: {:?}", tarantool_instance.request(&call).unwrap_or_else(&error_handler));

Eval

    let eval = Eval {
        expression: r#"return 5+5"#,
        keys: &vec![]
    };

    debug!("Eval result: {:?}", tarantool_instance.request(&eval).unwrap_or_else(&error_handler));

Upsert

    let upsert = Upsert {
        space: 512,
        keys: &vec![Value::from(5)],
        operation_type: UpsertOperation::Add,
        field_number: 2,
        argument: 2,
    };

    debug!("Upsert result: {:?}", tarantool_instance.request(&upsert).unwrap_or_else(&error_handler));

#Roadmap

  • Without heap-allocation
  • Sync connector
  • Ergonomic API with builders
  • Async connector
  • Full test coverage
  • Full-application examples
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].