Skip to content

SzymonScib/Json_DBMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SZBD Project

Overview

The SZBD project is a simple SQL-like database engine implemented in C#. It includes a storage layer, a query engine, and a client application to interact with the database. The project supports basic SQL operations such as SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, and DROP TABLE.

Project Structure

  • ClientApp: Contains the client application to interact with the database.
  • QueryEngine: Implements the SQL-like query engine.
  • StorageLayer: Manages data storage and indexing using B-Trees.
  • SZBD.Tests: Contains unit tests for the project.

Data Flow Diagram

Below is a diagram illustrating the data flow and interactions between the different layers of the SZBD project:

graph TD;
    ClientApp -->|Sends SQL Commands| QueryEngine;
    QueryEngine -->|Parses and Executes| StorageLayer;
    StorageLayer -->|Stores and Retrieves Data| QueryEngine;
    QueryEngine -->|Returns Results| ClientApp;
Loading

Installation

  • Download the ClientAppv1.0.0.rar file from releases.
  • Extract the contents of the .rar file using software like WinRAR or 7-Zip.
  • Run ClientApp.exe to start the application.

Prerequisites

  • .NET 8.0 SDK
  • Visual Studio or any C# compatible IDE

Building the Project

  1. Clone the repository:
    git clone <repository-url>
    cd SZBD
  2. Build the solution:
    dotnet build

Running the Client Application

  1. Navigate to the ClientApp directory:
    cd ClientApp
  2. Run the application:
    dotnet run

Running Tests

  1. Navigate to the SZBD.Tests directory:
    cd SZBD.Tests
  2. Run the tests:
    dotnet test

Usage

On the first use, the application will ask for a directory that will be used as a storage for JSON files, you need to specify a folder like: C:\databasefolder Once the storage directory is specified and client application is running, you can interact with the database using SQL-like commands. Here are some examples:

  • Create a table:

    CREATETABLE Users (Id INT PRIMARY KEY, Name STRING, Age INT);
  • Insert a row:

    INSERTINTO Users (Id, Name, Age) VALUES (1, 'John Doe', 30);
  • Select all rows:

    SELECT * FROM Users;
  • Update a row:

    UPDATE Users SET Age = 31 WHERE Id = 1;
  • Delete a row:

    DELETE FROM Users WHERE Id = 1;
  • Drop a table:

    DROPTABLE Users;

Acknowledgements

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages