Skip to content

dfithian/dfdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFDB

A simple database created for the purposes of learning database architecture.

Usage

$ stack run dfdb
Welcome to DFDB

Enter "help" to get this text
  Quit commands: :q, quit(), exit

dfdb > 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 DFDB

Enter "help" to get this text
  Quit commands: :q, quit(), exit

dfdb > select (string, int,) foo where (int = 1,);
["string",1]
dfdb > drop table foo;
DROP TABLE
dfdb > select (string, int,) foo;
Table does not exist

dfdb > :q

Internals

  • If you want to start from scratch, rm -rf .dfdb

Features

  • create, drop table
  • insert
  • select
  • update
  • nullable/non-nullable columns
  • primitive types
  • persist to disk
  • primary keys
  • foreign keys
  • indexes
  • query planning
  • autocommit transactions
  • transactions

Benchmarks

For info about benchmarks, see benchmark.pdf.

About

Write my own database from scratch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published