@@ -34,7 +34,7 @@ Note that this transaction graph approach is different from that of most SQL DBM
35#### Commit
35#### Commit
37−To convert a mutable database context into a transaction, it must be "committed" to the transaction graph.
37+To convert a mutable database context into a transaction, it must be "committed" to the transaction graph. The equivalent in SQL is COMMIT.
40TutorialD (master): :commit
40TutorialD (master): :commit
@@ -44,4 +44,72 @@ Once committed, the transaction's database context becomes immutable. Internally
45#### Rollback
45#### Rollback
47−Sometimes, the user determines that the changes in the mutable database context can be discarded and the context reset to be a copy of its parent's transaction. This is called a "rollback" because it rolls back to a previous known state.
47+Sometimes, the user determines that the changes in the mutable database context can be discarded and the context reset to be a copy of its parent's transaction. This is called a "rollback" because it rolls back to a previous known state. The equivalent in SQL is ROLLBACK.
50+TutorialD (master): :rollback
53+#### Show Transaction Graph
55+In order to navigate the transaction graph, one must specify transaction UUIDs. Viewing the entirety of the transaction graph as a relation is a single command.
58+TutorialD (master): :showgraph
59+┌───────┬──────┬────────────────────────────────────┬───────┐
60+│current│head │id │parents│
61+├───────┼──────┼────────────────────────────────────┼───────┤
64+The "current" attribute is a boolean value. If true, the transaction is the parent of the current database context. Commits will be children of this transaction.
66+The "head attribute is a boolean value indicating whether or not the transaction is a "head" node of its graph. Head nodes are nodes which have no children.
68+The "id" attribute is the UUID needed in order to navigate the graph.
70+The "parents" attribute is a subrelation holding all parent transaction UUIDs for the given transaction.
75+A new branch can be create from any point in the transaction. A branch associates a human-readable name with a set of transactions diverging from a parent transaction. After a branch, there are two heads to which one could commit.
78+TutorialD (master): :branch testing_data_2005
79+TutorialD (testing_data_2005):
82+Note how the prompt refers to the new branch. This indicates that further commits from the mutable database context will now be added to the new branch.
86+To switch the current mutable database context to refer to a different branch, jump to a different head. Committing to a head ensure that the branch growth continues linearly.
88+Note that jumping to another head implies losing any changes in the current database context.
91+TutorialD (testing_data_2005): :jumphead master
95+Further commits will be added to the target branch.
97+#### Jump to Transaction
99+Instead of jumping to the head of a branch for the purpose of adding more commits, it can be also useful to jump to a specific transaction in the past for two possible reasons:
101+* to examine the state of the database in the past; for example, for auditing purposes
102+* to branch the database from a point in the past
104+If one jumps to a non-head transaction, committing new transactions are no longer possible because the past transactions cannot be overwritten.
107+TutorialD (master): :jump 11b601c9-f46b-42b0-a2ce-cf18ced31b7f
108+TutorialD (11b601c9-f46b-42b0-a2ce-cf18ced31b7f):
111+Note that the ```tutd``` prompt now indicates that the mutable database context now refers to a specific transaction by UUID.