Skip to content

imaarov/SSDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSDB

Simple simple DB

Phase 1

supports list

  • two operation (insert / select)
  • store only in memory (no persistence to disk)
  • support single hard-code table

Table

For first phase the table structure is hard-code and its single one.

Column Type
id integer
username varchar(32)
email varchar(255)

Set up the DB and some command sample

  1. Run the bin file in out/bin/SSDB by ./out/bin/SSDB mydb.db
  2. Exit the prompt with !exit or !q
  3. run command (:
ssdb > insert 1 cstack [email protected]
Executed.
ssdb > insert 2 bob [email protected]
Executed.
ssdb > select
(1, cstack, [email protected])
(2, bob, [email protected])
Executed.
ssdb > insert foo bar 1
Syntax error. Could not parse statement.
ssdb > .exit

TDD of DB

for making test i use RSpec you can test it with following command

$ bundle config set --local path '.bundle'
$ bundle install
$ bundle exec rspec

Reference

Until phase 1 i complete the db with this great tutorial

About

simple simple DB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published