How grizzly4ctual/gopherstore works
Gopher Store is a Go relational database exposed as an interactive command shell. The main workflow is user input through command dispatch, then transactional table operations and indexed or scanned retrieval, backed by a persistent page store. The README also describes key constraints, concurrent access, and query filtering. The graph follows relationships explicit in sampled code or README; implementation detail for some documented capabilities is unsampled, so those links are documented rather than inferred from module names.
Main entry points: persist.go KV Store · commands.go Command Handlers · updates.go Table Operations · b_tree.go B+ Tree
Components 18
Interactive Shell
- Program Entry
main.go - Shell Runtime
database/database_impl.go - Command Handlers
database/commands.go - Input Helpers
database/helper/helper.go
Relational Operations
- Records and Schema
database/record.go - Table Operations
database/updates.go - Transactions
database/transactions.go - Index Management
database/indexes.go
Query Retrieval
- Query Dispatch
database/commands.go - Range Scanner
database/range.go - Table Scanner
database/table_scanner.go
Storage Engine
- KV Store
database/persist.go - B+ Tree
database/b_tree.go - Page Free List
database/free_list.go - Memory Mapping
database/mmap_windows.go
Concurrency
- Worker Pool
database/workers.go
Other components
- Database User
- Database File
Connections 20
- Database User → Program Entry: starts
README.md - Program Entry → Shell Runtime: starts shell
main.go - Shell Runtime → Command Handlers: dispatches commands
database/database_impl.go - Command Handlers → Input Helpers: prompts for input
database/commands.go - Command Handlers → Table Operations: runs mutations
database/commands.go - Command Handlers → Transactions: controls transactions
database/commands.go - Command Handlers → Query Dispatch: submits queries
database/commands.go - Table Operations → Records and Schema: validates and encodes
database/updates.go - Table Operations → Index Management: maintains indexes
database/updates.go - Table Operations → KV Store: updates keys
database/updates.go - Transactions → KV Store: commits changes
- Query Dispatch → Range Scanner: runs range scans
database/commands.go - Query Dispatch → Table Scanner: runs filtered scans
- Query Dispatch → Worker Pool: submits work
database/commands.go - Range Scanner → B+ Tree: seeks keys
database/range.go - Table Scanner → B+ Tree: scans records
- KV Store → B+ Tree: persists pages
database/persist.go - KV Store → Page Free List: allocates pages
database/persist.go - KV Store → Memory Mapping: maps database file
database/persist.go - KV Store → Database File: reads and writes
database/persist.go