You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you're writing a function that takes a Transaction parameter, that you know needs to write to the DB, and would like the compilation to fail if you accidentally pass it a transaction that could be read-only.
Current Workaround
Use Transaction / TypeDBTransaction and write correct code.
Proposed Solution
@dmitrii-ubskii has proposed the following structure for the Rust driver:
pubstructRead;pubstructWrite;pubstructTransaction<Type>;// Read or Write
It's achievable, but requires buy-in from the rest of the architecture, as those generics are infectious.
Additional Information
In Java we'd have used subclasses - TypeDBTransaction.Write and TypeDBTransaction.Read.
The text was updated successfully, but these errors were encountered:
alexjpwalker
changed the title
Make compilation able to differentiate a Write and a Read transaction
Make Write and Read transactions distinguishable at compile-time
Aug 30, 2024
Problem to Solve
Suppose you're writing a function that takes a Transaction parameter, that you know needs to write to the DB, and would like the compilation to fail if you accidentally pass it a transaction that could be read-only.
Current Workaround
Use
Transaction
/TypeDBTransaction
and write correct code.Proposed Solution
@dmitrii-ubskii has proposed the following structure for the Rust driver:
It's achievable, but requires buy-in from the rest of the architecture, as those generics are infectious.
Additional Information
In Java we'd have used subclasses -
TypeDBTransaction.Write
andTypeDBTransaction.Read
.The text was updated successfully, but these errors were encountered: