Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sojebsikder/go-base
Simple database engine created with golang
https://github.com/sojebsikder/go-base
database-engine go golang
Last synced: 3 days ago
JSON representation
Simple database engine created with golang
- Host: GitHub
- URL: https://github.com/sojebsikder/go-base
- Owner: SojebSikder
- Created: 2022-08-13T04:20:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-24T09:42:43.000Z (almost 2 years ago)
- Last Synced: 2023-07-20T14:53:03.920Z (over 1 year ago)
- Topics: database-engine, go, golang
- Language: Go
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-base
Simple database engine created with golang just for fun.
**Note: Currently query based db not working properly, any kind of contributions are welcome.**
### Todo:
- ~~Create cli (querydb)~~
- ~~Execute query file (querydb)~~
- implement writing data (querydb)
- implement b-tree for reading data (querydb)## Usage
### In-memory key value based db
Run simple key value db from command line:
```
go run main.go mapdb-cli
```### query based db
Run query on command line:
```
go run main.go cli
```Run query from file
```
go run main.go run file.sql
```### Supported commands:
- Database oparations
- Create database
```sql
create db [blog]
```
- Drop database
```sql
drop db [blog]
```
- Select database
```sql
set db [blog]
```- Document oparations
- Create document:
```sql
create doc [user]
```- Insert data into document:
```sql
insert [user] {firstName} 'sojeb' {lastName} 'sikder'
```## How go-base query based db works under the hood
In the first place go-base takes query. Then go-base engine splits query into statement using semi-clone (;) seperator. Each statements goes to tokenizer for generating tokens. All the tokens goes to perser. Perser perse the statement with brackets, quotation delimiter etc. And all the parsed data goes to main operation unit for processing.