Toaster is a rudimentary sql database that implements a subset of the postgres protocol. Toaster will uses dgraph's badger(introduced in this nice blog post: https://blog.dgraph.io/post/badger) as the storage backend to build on the shoulder of giants. Since it's main purpose is learning it will forgo many of the complex features of modern DBMS.
I really don't know how this will look in the end but here some of my current goals:
- subset of postgres sql(create, insert, select, delete, update statements)
- support all major data types(numeric, text, bool,...)
- support go's
database/sql
- more....
- a small subset of sql vocabulary.
- a simple repl to check which keywords are currently supported.
NOTE: you need to install go for the following to work
- run tests: go test ./...
- run the repl: go run main.go
➜ go run cmd/main.go
Hello rugwirobaker! welcome to toaster!
Feel free to type in sql queries
To exit this prompt type in: '\q'
>> CREATE TABLE users (id INT, name TEXT, active BOOL);
{Literal:create Kind:CREATE}
{Literal:table Kind:TABLE}
{Literal:users Kind:IDENT}
{Literal:( Kind:(}
{Literal:id Kind:IDENT}
{Literal:int Kind:INT}
{Literal:, Kind:,}
{Literal:name Kind:IDENT}
{Literal:text Kind:TEXT}
{Literal:, Kind:,}
{Literal:active Kind:IDENT}
{Literal:bool Kind:BOOL}
{Literal:) Kind:)}
{Literal:; Kind:;}
>> \q
I like to think that toaser is an sql version of the monkey language described in writing an interpreter in go book