Giter Club home page Giter Club logo

sqlenginelite's Introduction

SQLEngineLite

A project implementing a lightweight SQLite engine from scratch with support for CREATE,INSERT, and SELECT queries, including mathematical operations on columns.

demo

Project Architecture

The project comprises of different components as shown below fig:-

  1. Parser: The parser component is responsible for analyzing and validating user-provided SQL queries. It ensures that the input queries are syntactically correct and adherent to the SQL language rules. In case of any errors or illegal input, the parser generates error messages for the user. Once validated, the parser invokes the appropriate methods in the RDBMS component to execute the specified operations.

  2. B+ Tree: The B+ Tree library is a standardized component offering a set of functions for performing CRUD (Create, Read, Update, Delete) operations in the context of SQL queries. It serves as a robust library for managing B+ tree data structures, providing efficient mechanisms for insertion, retrieval, updating, and deletion operations.

  3. RDBMS Engine: The RDBMS engine is the project's core, orchestrating backend operations by processing parsed tokens from the parser. It interacts with various components to manage user input, creating tables using the B+ Tree library, storing records, and providing outputs for select queries. The supported operations are SELECT, DROP, INSERT and CREATE.

  4. SQL Interface: The SQL interface comprises a set of APIs bridging the interaction between the core RDBMS, and the Mathematical Expression library. Serving as a wrapper, it facilitates seamless communication by encapsulating the internal APIs of the mathematical expression library.

  5. libMexpr.a: libMexpr.a is a math expression parser package that processes mathematical expressions, generating parse trees from input expressions typically found in select queries applied to columns. This file is compiled from this package.

The project is based on a Udemy course; for in-depth understanding, refer to this course.

Run

  • First, clone the repository:
gh repo clone srsawant34/SimpleSQLEngine
  • Compile the project:
cd SqlParser
sh compile.sh
  • Running the project:
./dbms.exe

MacOS

For macOS, I would recommend to use docker

  • make dockerfile:
# Use an official Ubuntu base image
FROM ubuntu:latest

# Install necessary packages
RUN apt-get update && \
    apt-get install -y \
    git \
    g++ \
    flex \
    sudo

# Set up a non-root user with sudo privileges
RUN useradd -ms /bin/bash user && \
    usermod -aG sudo user && \
    echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Set the working directory to the user's home directory
WORKDIR /home/user

# Switch to the non-root user
USER user
  • building the docker image:
docker build . -t ubuntu
  • running the container in interactive mode
docker run -it ubuntu

And repeat the above steps to run the project.

sqlenginelite's People

Contributors

srsawant34 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.