Skip to content

AltSumpreme/pebbledb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PebbleDB

PebbleDB is a simple,lightweight modular database being built in Go. It provides a SQL-like interface,an in-memory engine,and disk persistence via pages.

Warning

PebbleDB is a WIP

Most aspects of the project are under heavy development and no stable release is present as of yet.

Features

  • SQL-like REPL: SQL-like command parsing and execution
  • Engine Abstraction : Engine handles orchestration between parser, executor, and storage.
  • Binary Persistence : Data persists to disk in Binary format.
  • Page Management : Introduced fixed-size 4KB page abstraction.
  • Test Coverage : Initial unit tests for core DB operations.

Getting Started

Prerequisites

  • Go 1.20+ installed on your machine.

Installation

  1. Clone the repository:

    git clone https://github.com/AltSumpreme/pebbledb.git
    cd pebbledb
  2. Build and run the project:

    go run cmd/main.go

Usage

Once the application is running, you can interact with it via the command line.

Commands

  • CREATE:
CREATE TABLE table_name column_name:column type
  • INSERT
INSERT TO TABLE table_name (col1,col2) FROM VALUES (val1,val2)
  • SELECT

-To Select ALL Columns

SELECT * FROM table_name
  • Select Specific Columns
SELECT col1,col2 FROM table_name
  • DROP
DROP TABLE table_name
  • EXIT: Exit the database.

Future Plans

  • Persistence Layer: Add the ability to persist data
  • WAL: Adding WAL and it support to the later releases
  • Concurrency Support: Add support for concurrent access with read-write locks.
  • Additional Commands: Implement UPDATE and LIST commands.
  • Data Types: Support storing complex data types like arrays and structs.
  • Performance Optimization: Improve memory usage and introduce indexing.
  • CLI Enhancements: Add interactive mode and command history.
  • Error Handling: Enhance error handling for graceful recovery.
  • Testing and Documentation: Add unit tests and comprehensive documentation.

Testing

cd testing
go test

For more verbose output

go test -v

About

Currently a toy database that is being built in Go

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages