Simple type-safe relational algebra evaluator built entirely in Rust

Last update: May 30, 2022

ra-evaluator

A simple type-safe relational algebra evaluator.

Relational algebra provides the theoretical foundation for relational databases and the SQL language. This library provides a means to build expressions in the language of relational algebra and evaluate them to obtain a concrete result.

Features

  • Type safe and generic expressions operating on arbitrary tuples and structs.
  • Highly composable expression building based on the composite design pattern.
  • Recursive evaluation of complex chained expressions.

Future Possible Features

  • Visualization of expression trees.
  • Query rewriting and optimization.

Sample Usage

We can build relational algebra expressions using the ExpressionBuilder struct:

use ra_evaluator::{ExpressionBuilder, Terminal};

let query = ExpressionBuilder::new(Terminal::new(&[(1, "a"), (2, "b"), (3, "c")]))
    .select(|x| x.0 > 1)
    .project(|x| x.1)
    .cartesian_product(&[1, 2], |x, y| (*x, *y))
    .join(&[(1, "Join1"), (2, "Join2")], |x, y| x.1 == y.0, |x, y| (x.0, y.0, y.1))
    .union(&[("d", 3, "Union")])
    .intersect(&[
        ("c", 1, "Join1"),
        ("c", 2, "Join2"),
        ("d", 3, "Union"),
        ("e", 4, "Removed"),
    ]);
 
// Results in ``[("c", 1, "Join1"), ("c", 2, "Join2"), ("d", 3, "Union")]``
println!("{:?}", query.eval());

GitHub

https://github.com/V-Wong/ra-evaluator
You might also like...

A simple bayesian spam classifier written in Rust.

bayespam A simple bayesian spam classifier. About Bayespam is inspired by Naive Bayes classifiers, a popular statistical technique of e-mail filtering

Jan 27, 2022

This repository features a simple Kalman filter and RTS smoother (KFS) implementation in Rust by using the ndarray library.

This repository features a simple Kalman filter and RTS smoother (KFS) implementation in Rust by using the ndarray library.

Kalman filter and RTS smoother in Rust (ndarray) This repository features a simple Kalman filter and RTS smoother (KFS) implementation in Rust by usin

Jan 25, 2022

A simple neural net implementation.

PROPHET - Neural Network Library Linux Windows Codecov Coveralls Docs Crates.io A simple neural net implementation written in Rust with a focus on cac

Apr 6, 2022

Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

Jun 16, 2022

Practice repo for learning Rust. Currently going through "Rust for JavaScript Developers" course.

rust-practice 🦀 Practice repo for learning Rust. Directories /rust-for-js-dev Files directed towards "Rust for JavaScript Developers" course. Thank y

Dec 25, 2021

A Rust machine learning framework.

Linfa linfa (Italian) / sap (English): The vital circulating fluid of a plant. linfa aims to provide a comprehensive toolkit to build Machine Learning

Jun 18, 2022

Machine Learning library for Rust

rusty-machine This library is no longer actively maintained. The crate is currently on version 0.5.4. Read the API Documentation to learn more. And he

Jun 15, 2022

Rust library for Self Organising Maps (SOM).

Rust library for Self Organising Maps (SOM).

RusticSOM Rust library for Self Organising Maps (SOM). Using this Crate Add rusticsom as a dependency in Cargo.toml [dependencies] rusticsom = "1.1.0"

Jul 28, 2021

Rust language bindings for TensorFlow

Rust language bindings for TensorFlow

TensorFlow Rust provides idiomatic Rust language bindings for TensorFlow. Notice: This project is still under active development and not guaranteed to

Jun 23, 2022
Cleora AI is a general-purpose model for efficient, scalable learning of stable and inductive entity embeddings for heterogeneous relational data.
Cleora AI is a general-purpose model for efficient, scalable learning of stable and inductive entity embeddings for heterogeneous relational data.

Cleora Cleora is a genus of moths in the family Geometridae. Their scientific name derives from the Ancient Greek geo γῆ or γαῖα "the earth", and metr

Jun 19, 2022
A linear algebra library written in Rust

rulinalg This library is no longer actively maintained The crate is currently on version 0.4.2. Read the API Documentation to learn more. Summary Ruli

May 17, 2022
Static Linear Algebra System

SLAS Static Linear Algebra System Provides statically allocated vector, matrix and tensor types, for interfacing with blas/blis, in a performant manor

Apr 15, 2022
Nov 4, 2020
Simple WIP GPGPU framework for Rust built on top of wgpu

gpgpu A simple GPU compute library based on wgpu. It is meant to be used alongside wgpu if desired. To start using gpgpu, just create a Framework inst

Jun 22, 2022
A fast, safe and easy to use reinforcement learning framework in Rust.
A fast, safe and easy to use reinforcement learning framework in Rust.

RSRL (api) Reinforcement learning should be fast, safe and easy to use. Overview rsrl provides generic constructs for reinforcement learning (RL) expe

Jun 17, 2022
A safe Rust wrapper around a subset of cuFFT.

cufft_rust This is a safe Rust wrapper around CUDA FFT (cuFFT). It only supports a subset of the API which I need for private projects. For now this o

Jan 11, 2022
A Rust library with homemade machine learning models to classify the MNIST dataset. Built in an attempt to get familiar with advanced Rust concepts.

mnist-classifier Ideas UPDATED: Finish CLI Flags Parallelize conputationally intensive functions Class-based naive bayes README Image parsing Confusio

Sep 2, 2021
Simple neural network library for classification written in Rust.

Cogent A note I continue working on GPU stuff, I've made some interesting things there, but ultimately it made me realise this is far too monumental a

Apr 13, 2022
Simple Neural Network on rust

Simple Artificial Neural Network A crate that implements simple usage of dense neural networks. Instalation Add this to your dependencies on Cargo.tom

May 21, 2022