-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01e9c6c
commit c8d902b
Showing
3 changed files
with
441 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
-- inode table and main entrypoint of the schema | ||
CREATE TABLE IF NOT EXISTS inode ( | ||
ino INTEGER PRIMARY KEY AUTOINCREMENT, | ||
parent INTEGER, | ||
name VARCHAR(255), | ||
size INTEGER, | ||
uid INTEGER, | ||
gid INTEGER, | ||
mode INTEGER, | ||
rdev INTEGER, | ||
ctime INTEGER, | ||
mtime INTEGER | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS parents ON inode (parent); | ||
|
||
-- extra data for each inode for special types (say link targets) | ||
CREATE TABLE IF NOT EXISTS extra ( | ||
ino INTEGER PRIMARY KEY, | ||
data VARCHAR(4096) | ||
); | ||
|
||
-- blocks per file, order of insertion is important | ||
CREATE TABLE IF NOT EXISTS block ( | ||
ino INTEGER, | ||
hash VARCHAR(16), | ||
key VARCHAR(16) | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS block_ino ON block (ino); | ||
|
||
-- global flist tags, this can include values like `version`, `description`, `block-size`, etc.. | ||
-- it can also hold extra user-defined tags for extensions | ||
CREATE TABLE IF NOT EXISTS tag ( | ||
key VARCHAR(10) PRIMARY KEY, | ||
value VARCHAR(255) | ||
); | ||
|
||
-- routing table define ranges where blobs can be found. This allows "sharding" by be able to retrieve | ||
-- blobs from different partitions using the prefix range (hashes that are ) | ||
CREATE TABLE IF NOT EXISTS route ( | ||
start integer, -- one byte hash prefix | ||
end integer, -- one byte hash prefix | ||
url VARCHAR(2048) | ||
); |
Oops, something went wrong.