spinframework / spinframework/spin
Add first-class transaction support for DBMS in Spin SDKs
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
It would be really handy to have first-class support for transactions when interacting with DBMS like PostgreSQL or MySQL.
As of today it is possible to concat multiple commands and surround those with BEGIN and COMMIT to use transactions. Although this works, it comes at the cost of ending up with longer TSQL statements.
In contrast, having first-class support for transactions, would result in
- cleaner representation in code
- prevent myself from writing even more plain TSQL
- have compile-time check
See the following (pseudo-code) for illustration.
// ...
let connection = Connection::open(connection_string)?;
let tx = connection::begin_transaction();
let res1 = tx.execute("MY 1ST COMMAND", ¶ms);
let res2 = tx.execute("MY 2ND COMMAND", ¶ms);
match tx.commit() {
Ok(res) => , // ...
Err(e) => tx.rollback(), // ...
}
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
The issue names no repository files or tests. Start by locating the SDK connection flow represented by Connection::open and the proposed begin_transaction, execute, commit, and rollback calls, then compare current PostgreSQL and MySQL command handling. Done means a defined first-class transaction API with compile-time checking and documented commit or rollback behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, postgresql, rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100