Skip to content

Introduce RW transactions - #139

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

Introduce RW transactions#139
incipit0 wants to merge 3 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

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 mentioned this pull request Sep 2, 2026
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.
@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
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