- Implementation of simple DB(sqlite based) using C
- Reference: Lets' Build a Simple Database
make
./main test.db
bundle install
make test
select
(1, user1, person1@example.com)
(2, user2, person2@example.com)
(3, user3, person3@example.com)
# id name email
insert 1 user user@user.com
.btree
Tree:
- internal (size 1)
- leaf (size 7)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- key 7
- leaf (size 8)
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
.constants
Constants:
ROW_SIZE: 293
COMMON_NODE_HEADER_SIZE: 6
LEAF_NODE_HEADER_SIZE: 14
LEAF_NODE_CELL_SIZE: 297
LEAF_NODE_SPACE_FOR_CELLS: 4082
LEAF_NODE_MAX_CELLS: 13
- Install CodeLLDB extension
- Check
tasks.json
andlaunch.json
- Set breakpoints
- Run(F5)
- 231009: Splitting Internal Nodes
- 231007: Updating Parent Node After a Split
- 231004: Scanning a Multi-Level B-Tree
- 231004: Recursively Searching the B-Tree
- 231003: Splitting a Leaf Node
- 231002: Binary Search and Duplicate Keys
- 231001: B-Tree Leaf Node Format
- 230930: The Cursor Abstraction
- 230929: Persistence to Disk
- 230924: Our First Tests (and Bugs)
- 230923: An In-Memory, Append-Only, Single-Table Database
- 230921: World’s Simplest SQL Compiler and Virtual Machine
- 230920: Introduction and Setting up the REPL