-
Notifications
You must be signed in to change notification settings - Fork 0
Repository
Eric Hanson edited this page May 17, 2025
·
1 revision
This page describes the internal data structures of a repository and its commits, stage and row tracking. See here for design discussion.
-
name text- Repository name -
head_commit_id uuid- The id of the commit that is currently being developed against. Next commit will use this commit as its parent, and all track, stage and diff functions compare the live db against the contents of this commit. -
checkout_commit_id uuid- The commit that is currently checked out into the database, maintained by thedelta.checkout()function. -
tracked_rows_added jsonb- Array ofrow_id::textvalues -
stage_rows_to_add jsonb- Array ofrow_id::textvalues? See Stage-by-Reference vs. Value -
stage_rows_to_remove jsonb- Array ofrow_id::textvalues -
stage_fields_to_change jsonb- Array offield_id::textvalues
Rows that have been staged for inclusion in the next commit, along with their value at stage time.
JSONB Object with key row_id::text and value of jsonb object with key column name and value of field value at stage time.
{
"(shakespeare,character,{id},{Aaron})": {
"id": "Aaron",
"name": "Aaron",
"abbrev": "AARON",
"description": "a Moor, beloved by Tamora",
"speech_count": 57
},
"(shakespeare,character,{id},{Bagot})": {
"id": "Bagot",
"name": "Bagot",
"abbrev": "BAGOT",
"description": "servant to King Richard II",
"speech_count": 6
}
}JSONB Array of row_id::text values - rows that have been staged for deletion from the previous commit, to be excluded in the next commit
[
"(shakespeare,character,{id},{Aaron})",
"(shakespeare,character,{id},{Bagot})"
]
JSONB Object, with key field_id::text and value of field's value at stage time.
{
"(shakespeare,character,{id},{Aaron},name)": "Sally",
"(shakespeare,character,{id},{Bagot},name)": "Joe"
}-
parent_id uuid- foreign key to the previous commit, or NULL for first commit. -
merge_parent_id uuid- If this commit is a merge, references the second commit that is being merged with theparent_idcommit. -
jsonb_rows- Array ofrow_ids, the contents of this commit, sorted in checkout order. -
jsonb_fields- Object of fields in the commit.- Object keys are
row_id::text - Object values are a sub-Object:
- Object keys are column names
- Object values are field values, potentially hashed according to hash rules
- Object keys are
author_name textauthor_email textmessage textcommit_time text