Lightweight, Strongly Typed Xata Client written in Rust

Related tags

Database xata-rs
Overview

xata-rs: Lightweight, Strongly Typed Xata Client

xata-rs is a third party Xata client, allowing interaction with Xata's REST API.

Adding xata-rs (WIP)

cargo add xata-rs

API

Create a new client

let xata: Xata = Xata::new(
    api_key: "my_key".to_owned(),
    workspace: "workspace_id".to_owned(),
    region: Region::US_EAST_1
);

or from env variables

let xata: Xata = Xata::from_env();

Call an endpoint (for more info, check the xata docs)

let user: User = xata.users.get_details()?;
println!("{#?}", user)
> User { "usr_XXXXX", "quanturtle", "[email protected]" }
let mut payload: HashMap<String, String> = HashMap::new();
payload.insert("email".to_owned(), "your_email".to_owned());
payload.insert("fullname".to_owned(), "another name".to_owned());

let updated_user: User = xata.users.update_user_info(payload).unwrap();

println!("{#?}", updated_user)
> User { "usr_XXXXX", "another name", "[email protected]" }

API Endpoints

Users
Authentication
Workspaces
Invites
Databases
Branch
Migrations
Table

Errors

The enum XataClientError contains all errors that could arise from the use of the client. To map XataClientError to your application, implement From<>:

impl From<XataClientError> for MyApplicatioError {
    fn from(error: XataClientError) -> Self {
        MyApplicationError::MyCustomError(error)
    }
}

TODO

  • Add async support with tokio for POST requests
  • support for datetime objects with chronos
  • query endpoint and QueryBuilder
You might also like...
Ratchet is a fast, robust, lightweight and fully asynchronous implementation of RFC6455 (The WebSocket protocol).

Ratchet 🚧 Ratchet is a fast, robust, lightweight and fully asynchronous implementation of RFC6455 (The WebSocket protocol). Complete with an optional

lightweight, async and zero-copy KV Store
lightweight, async and zero-copy KV Store

KipDB 介绍 网络异步交互、零拷贝的轻量级KV数据库 基于PingCAP课程talent-plan 课程地址:https://github.com/pingcap/talent-plan/tree/master/courses/rust 内置多种持久化内核 HashStore: 基于哈希 Sle

Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. 💡 Looking for an async version? async-std https://github.c

High-level async Cassandra client written in 100% Rust.
High-level async Cassandra client written in 100% Rust.

CDRS tokio CDRS is production-ready Apache Cassandra driver written in pure Rust. Focuses on providing high level of configurability to suit most use

CouchDB client-side library for the Rust programming language

Chill Chill is a client-side CouchDB library for the Rust programming language, available on crates.io. It targets Rust Stable. Chill's three chief de

A Rust client for the ElasticSearch REST API

rs-es Introduction An ElasticSearch client for Rust via the REST API. Targetting ElasticSearch 2.0 and higher. Other clients For later versions of Ela

An Elasticsearch REST API client for Rust

elastic elastic is an efficient, modular API client for Elasticsearch written in Rust. The API is targeting the Elastic Stack 7.x. elastic provides st

An etcd client library for Rust.

etcd An etcd client library for Rust. etcd on crates.io Documentation for the latest crates.io release Running the tests Install Docker and Docker Com

Mysql client library implemented in rust.

mysql This crate offers: MySql database driver in pure rust; connection pool. Features: macOS, Windows and Linux support; TLS support via nativetls cr

Owner
Alvaro Machuca Recalde
math & data & tinkering
Alvaro Machuca Recalde
Lightweight async Redis client with connection pooling written in pure Rust and 100% memory safe

redi-rs (or redirs) redi-rs is a Lightweight Redis client with connection pooling written in Rust and 100% memory safe redi-rs is a Redis client writt

Oğuz Türkay 4 May 20, 2023
Fully typed SQL query builder for Rust [deprecated]

What is Deuterium? Deuterium is a fancy SQL builder for Rust. It's designed to provide a DSL to easily build SQL queries in safe and typed way. Like R

Stanislav Panferov 169 Nov 20, 2022
Rust client for Timeplus Proton, a fast and lightweight streaming SQL engine

Rust Client for Timeplus Proton Rust client for Timeplus Proton. Proton is a streaming SQL engine, a fast and lightweight alternative to Apache Flink,

Timeplus 4 Feb 27, 2024
Lightweight unifying client for RPC + BanksClient

Ellipsis Client Lightweight unifying client for RPC + BanksClient There are no good unifying traits for Solana Rust clients. EllipsisClient creates a

Ellipsis Labs 16 Dec 24, 2022
Async Lightweight HTTP client using system native library if possible. (Currently under heavy development)

Async Lightweight HTTP Client (aka ALHC) What if we need async but also lightweight http client without using such a large library like reqwest, isahc

SteveXMH 7 Dec 15, 2022
ReadySet is a lightweight SQL caching engine written in Rust that helps developers enhance the performance and scalability of existing applications.

ReadySet is a SQL caching engine designed to help developers enhance the performance and scalability of their existing database-backed applications. W

ReadySet 1.7k Jan 8, 2023
Affine-client is a client for AFFINE based on Tauri

Affine Client affine-client is a client for AFFINE based on Tauri Supported Platforms Windows Linux MacOS Download https://github.com/m1911star/affine

Horus 216 Dec 25, 2022
PickleDB-rs is a lightweight and simple key-value store. It is a Rust version for Python's PickleDB

PickleDB PickleDB is a lightweight and simple key-value store written in Rust, heavily inspired by Python's PickleDB PickleDB is fun and easy to use u

null 155 Jan 5, 2023
RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.

RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.

Qovery 145 Nov 23, 2022
Garage is a lightweight S3-compatible distributed object store

Garage [ Website and documentation | Binary releases | Git repository | Matrix channel ] Garage is a lightweight S3-compatible distributed object stor

Deuxfleurs 156 Dec 30, 2022