> For the complete documentation index, see [llms.txt](https://webbery.gitbook.io/civet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://webbery.gitbook.io/civet/database/design.md).

# 架构设计

## 接口层

TODO

## 数据库管理层

### 增删改

TODO

### 查

在查询上，使用了PEGTL库。这个库采用了PEG文法，来解析输入文本，并生成语法树。\
在civet的数据库查询实现中，自定义了查询语言，基于该语言，生成了一棵抽象语法树。\
在规划器的实现中，采用了一个调度表，记录语法树叶节点的平均耗时；并根据抽象语法树构建了一个偏序规划

## 存储层

存储层使用了第三方库lmdb。这个库构建于共享内存之上，提供了K-V存储。因此能够提供相当高效的速度和性能。
