hughdazz / tinydb

A database implementation from scratch in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tinydb

A database implementation from scratch in Rust for study purpose.


The most implementations is based on Postgresql implementation itself. Some design choices are:

Building

Tinydb is develop in Rust, so it's necessary to have the Rust build toolchain installed.

Once you have installed the Rust toolchanin, just clone the repository, build the binary and run.

  • git clone https://github.com/msAlcantara/tinydb
  • cargo install --path .

Usage

Tinydb is a server database that implements the PostgreSQL Wire Protocol so any PostgreSQL client can be used with tinydb.

The database directory should be initialized when running tinydb for the first time: tinydb --init

For second run, you can just type tinydb to start the server with default configurations.

And them you can connect using psql or any other Postgres client:

psql -h localhost -p 6379 -d tinydb

Data types

The supported data types are

  • INT
  • VARCHAR
  • BOOL

Example

CREATE TABLE t(a int, b varchar, c boolean);

INSERT INTO t(a, b, c) VALUES(42, 'tinydb', true);

SELECT * FROM t;

About

A database implementation from scratch in Rust

License:MIT License


Languages

Language:Rust 100.0%