Skip to content

Latest commit

 

History

History
63 lines (47 loc) · 1.12 KB

File metadata and controls

63 lines (47 loc) · 1.12 KB

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.