跳转到正文

Rust SQLite

Last Updated:

Rust SQLite

01. SQLite 基础

了解 SQLite 整体架构
了解 SQLite 数据库文件格式
了解 Page / B-Tree / Pager
阅读 SQLite 官方文档
阅读 SQLite 源码结构

02. Storage

实现 Database File
实现 Page
实现 Pager
实现 Page Cache
实现磁盘读写
实现数据库文件初始化

03. Record

设计 Row
设计 Column
实现 INTEGER
实现 REAL
实现 TEXT
实现 BLOB
实现 NULL
实现 Row Serialization
实现 Row Deserialization

04. B-Tree

实现 B-Tree
实现 Node
实现 Leaf Node
实现 Interior Node
实现 Search
实现 Insert
实现 Delete
实现 Node Split
实现 Node Merge
实现 B-Tree Persistence

05. Table

实现 Table
实现 Schema
实现 Column Definition
实现 Primary Key
实现 Table Scan
实现 Row Insert
实现 Row Delete
实现 Row Update

06. SQL Lexer

实现 Token
实现 Keyword
实现 Identifier
实现 Number
实现 String
实现 Operator
实现 Lexer

07. SQL Parser

实现 AST
CREATE TABLE
INSERT
SELECT
UPDATE
DELETE
WHERE
ORDER BY
LIMIT
Expression
Comparison
AND / OR

08. Query Engine

实现 Query Executor
实现 Projection
实现 Filter
实现 Table Scan
实现 Index Scan
实现 Expression Evaluation
实现 Query Planner
实现简单优化

09. Index

实现 Index
B-Tree Index
CREATE INDEX
Index Insert
Index Delete
Index Lookup
使用 Index 优化 SELECT

10. Transaction

实现 Transaction
BEGIN
COMMIT
ROLLBACK
实现 WAL
Crash Recovery
Checkpoint
Atomic Commit

11. Concurrency

Concurrent Read
Concurrent Write
Lock
Reader / Writer
Transaction Isolation
MVCC 基础

12. SQLite 兼容性

支持常用 SQLite SQL
对比 SQLite 查询结果
对比 SQLite 数据库文件
SQLite Test Suite
Benchmark
Compatibility Test

13. Rust API

设计 Database API
设计 Connection API
设计 Statement API
设计 Row API
设计 Transaction API
参数绑定
Error API

14. CLI

实现数据库 CLI
SQL REPL
.open
.tables
.schema
.help
.quit

15. 完成

Mini SQLite
Benchmark
单元测试
集成测试
Crash Recovery 测试
并发测试
编写技术总结
阅读 SQLite 核心源码
对比自己的实现与 SQLite