Skip to content

Introduce RW transactions - #139

Open
incipit0 wants to merge 11 commits into
mainfrom
coln-store/rw-txn
Open

Introduce RW transactions#139
incipit0 wants to merge 11 commits into
mainfrom
coln-store/rw-txn

Conversation

@incipit0

@incipit0 incipit0 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Continuation of #138.

@acurrieclark, I added a couple more stuff so now can do R/W on a transaction, and there are also convenience methods like store.add() which will start a transaction for you, add the value, and immediately close it. In general it is not a good thing to do lots of single-shot commit will consume lots of space, but may be nice to have for demo and experimenting.

See the store-access.test for example

@incipit0 incipit0 mentioned this pull request Sep 2, 2026
@acurrieclark

Copy link
Copy Markdown
Collaborator

Understood, thanks very much.

One thing about the add convenience method; it will bypass any syncing and storage provided by automerge-repo. Everything there would be done via handle.change(txn => {...etc})

Automerge itself offers similar ways to update documents, so I am not suggesting this isn't useful. Only that I don't think it will be immediately relevant to the work I am doing here.

@incipit0

incipit0 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

One thing about the add convenience method; it will bypass any syncing and storage provided by automerge-repo. Everything there would be done via handle.change(txn => {...etc})

Makes sense, feel free to not use it if you think it's not useful in your case :)

@incipit0
incipit0 changed the base branch from main to trunk-for-2026-09-demo September 3, 2026 09:58
@incipit0
incipit0 changed the base branch from trunk-for-2026-09-demo to main September 3, 2026 18:35
Rewrite some of the indexing methods. Introduce TableHandle::inner()
which allows internal packages to use PackedRowId methods if they wish
to.
Now that they are called TxnLiveRowId.
Also did rename SortedTableSnapshot -> SortedTable. snapshot means
something special in coln-store, where it is used to rollback operations.
`TableHandle` handles the packing/unpacking to and from WireRowId <->
PackedRowId.

Also fold TableMut into TableHandle, not on TestTable.
An empty commit will return early with a all-zero hash and not modify
the commit graph. In the future we might want to introduce an option
of something like --allow-empty.
Make txn able to read things from table. For now these are mostly dup
code from the StoreHandle. I want to redesign the RW interface from
coln-store so that might change.

For now, we can read stuff inside a transaction.
@incipit0
incipit0 force-pushed the coln-store/rw-txn branch 2 times, most recently from 445d57e to 4ed1cb8 Compare September 9, 2026 17:26
Add read/write transactions to coln-store, with typestate.

Add convenience methods to do single-shot read/write on the store,
internally they will start/finish a transaction for you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants