1
0
mirror of https://github.com/fumiama/fumidb.git synced 2026-06-16 09:10:25 +08:00

add types

This commit is contained in:
源文雨
2022-05-01 21:16:17 +08:00
parent eda10fba91
commit 67b9176615
17 changed files with 310 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
# 数据表格式
## 表头
如下所示,加上文件中附加的`ptr of next table`,表头永远是`4k`对齐的其中行类型列表的No.1自动成为主键,强制应用`unique`类型修饰符;`data blocks`可以为任意数据,如索引,表项等。由于数据块均为定长,增加时直接添加或重用已删除区块,修改时直接覆盖,删除时直接在索引中移除该项,将块首地址附加到已删除块的链表即可。
如下所示,加上文件中附加的`ptr of next table`,表头永远是`4k`对齐的其中行类型列表的No.1自动成为主键,强制应用`unique`+`nonnull`类型修饰符;`data blocks`可以为任意数据,如索引,表项等。由于数据块均为定长,增加时直接添加或重用已删除区块,修改时直接覆盖,删除时直接在索引中移除该项,将块首地址附加到已删除块的链表即可。
```
┌──────────┬──────────┬──────────┬──────────┬──────────┬──────────┬──────────┬──────────┐
│ 0 - 7 │ 8 - 15 │ 16 -- 23 │ 24 -- 31 │ 32 -- 39 │ 40 -- 47 │ 48 -- 55 │ 56 -- 63 │