tursodatabase / tursodatabase/libsql
Changes to Hrana protocol
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
This is a discussion thread for the proposals to change the Hrana protocol. Feel free to add anything you want to discuss.
To start with:
1. Add information about state of autocommit to every response
Currently (as of #759) we do it manually, by appending GetAutocommitReq to every batch, as it's required by libsql client in order to properly inform about the state of connection as perceived by the server. We could add it to ResponseOkMsg instead.
2. Use capabilities of StoreSql at Stmt level
Currently we use StoreSqlReq to cache SQL text under a specific (stream scoped) int identifier - later on we can reuse this id to avoid sending the same SQL text around. My guess is that it was supposed to work with prepared statements.
However current protocol has significant limitations:
SequenceReqthat is supposed to be used for stored sql ids doesn't allow to pass parameters.- It also doesn't allow to return responses.
- It cannot be used in batches.
The idea was to expand Stmt struct definition to enable using optional sql_id, that would work just like StoreSql command, but since it's defined at Stmt level, it could be used in all contexts that SequenceReq couldn't (meaning also all of the points above). I'm not sure how doable it is on the server side. Any feedback @MarinPostma ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docs/HRANA_3_SPEC.md and review the discussion of ResponseOkMsg, GetAutocommitReq, StoreSqlReq, SequenceReq, and Stmt. The issue contains multiple proposals rather than a decided change; done would require an agreed protocol design and corresponding specification or implementation scope.
Written by the indexing model from the issue text.
Assessment
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100