GoDBMS is a simple database management system completely written in Go. It is built on top of a B-tree based key-value store. This project is developed using the "Build Your Own Database From Scratch in Go" guide, which can be found at Build Your Own Database.
- B-tree based key-value store
- Support for creating tables with multiple columns
- Insert, update, delete, and upsert operations
- Secondary indexes for efficient querying
- SQL-like query language for interacting with the database
To install GoDBMS, clone the repository and build the project:
git clone https://github.com/yourusername/godbms.git
cd godbms
go build ./cmd/main.goTo start using GoDBMS, run the built executable:
./mainHere are examples of the query syntax supported by GoDBMS:
You can create tables with primary keys and indexes:
-- Multi-line format
create table demo (
id int,
name bytes,
index (id),
index (name),
primary key (id)
);
-- Single-line format
create table demo (id int, name bytes, index (id), index (name), primary key (id));Insert new records into a table:
insert into demo (id, name) values (1, abcd);Update existing records using an index condition:
update demo set @name = hello index by name == abcd;Delete records that match specified conditions:
delete from demo index by name == abcd;Retrieve data from tables:
select * from demo;This project is inspired by the "Build Your Own Database From Scratch in Go" guide. Special thanks to the authors for their excellent tutorial.