Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dfithian/dfdb
Write my own database from scratch
https://github.com/dfithian/dfdb
Last synced: 28 days ago
JSON representation
Write my own database from scratch
- Host: GitHub
- URL: https://github.com/dfithian/dfdb
- Owner: dfithian
- License: apache-2.0
- Created: 2020-09-01T23:49:55.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-22T15:00:34.000Z (almost 3 years ago)
- Last Synced: 2024-08-01T16:26:52.150Z (3 months ago)
- Language: Haskell
- Size: 2.71 MB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DFDB
A simple database created for the purposes of learning database architecture.
## Usage
```bash
$ stack run dfdb
Welcome to DFDBEnter "help" to get this text
Quit commands: :q, quit(), exitdfdb > create table foo (string string, int int, bool bool,);
CREATE TABLE
dfdb > insert ('string', 1, true,) foo;
INSERT 1
dfdb > select (string, int,) foo where (int = 1,);
["string",1]dfdb > create index foo_int foo (int,);
CREATE INDEX
dfdb > :q$ stack run dfdb
Welcome to DFDBEnter "help" to get this text
Quit commands: :q, quit(), exitdfdb > select (string, int,) foo where (int = 1,);
["string",1]
dfdb > drop table foo;
DROP TABLE
dfdb > select (string, int,) foo;
Table does not existdfdb > :q
```## Internals
* If you want to start from scratch, `rm -rf .dfdb`
## Features
- [x] create, drop table
- [x] insert
- [x] select
- [ ] update
- [ ] nullable/non-nullable columns
- [x] primitive types
- [x] persist to disk
- [x] primary keys
- [ ] foreign keys
- [x] indexes
- [x] query planning
- [x] autocommit transactions
- [x] transactions## Benchmarks
For info about benchmarks, see [benchmark.pdf](benchmark.pdf).