Closed MichaelScofield closed 1 year ago
Have you thought about other solutions like interior mutability(Cell/Mutex)?
If we pass mutable reference, then we can't execute query concurrently for one database, although not implemented yet, but may will in future.
I agree with @jiacai2050. Passing mutable reference here also prevents us from implementing "interceptors" that may hold the database's reference (though it's not implemented too 😩). Maybe Mutex
is a better choice for this case.
... so that we can change its internal state.
Which issue does this PR close?
Closes #
Rationale for this change
We need to impl
Database
like this:What changes are included in this PR?
Database
mutable borrowed in its methodquery
Are there any user-facing changes?
yes, implementors need to change their methods names
How does this change test