Coder Social home page Coder Social logo

rsql's Introduction

Custom SQL Interpreter & Engine

Reconstructing a relational database as a learning project in Rust

Check it out

  1. Clone repository and build binary using cargo build --release

  2. Use in one of two ways

    a. Using cli arg: pathto/binary "SQL query"

    b. Using the interactive shell. Start it by executing the binary without cli args. Quit it by submitting the character 'q'.

What r_sql can do

  1. Parse simple queries (SELECT (WHERE, AND), INSERT INTO, CREATE TABLE, CREATE INDEX)
  2. Handle simple reads/writes
  3. Use indices on columns for improved read performance

What r_sql cannot (yet) do

  1. More complex queries, including subqueries, SORT BY, ORDER BY, LIMIT, functions like COUNT() and the like
  2. Constraints, such as NOT NULL, DEFAULT _, UNIQUE, ..

TODOS

  • indices: allow a leaf to point to multiple data pages
  • basic constraints, such as NOT NULL, DEFAULT, UNIQUE
  • implement WAL
  • implement more of the common SQL syntax, such as DROP and UPDATE and DELETE

Limitations

I consciously chose to not implement logic for the following

  1. I don't handle the case that a single record exceeds the size of a datapage
  2. I don't implement DB metadata like users or privileges

rsql's People

Contributors

mudandstars avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.