Closed fernandobatels closed 3 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
rsfbclient-diesel/src/fb/query_builder.rs | 47 | 49 | 95.92% | ||
rsfbclient-diesel/src/fb/value.rs | 15 | 24 | 62.5% | ||
rsfbclient-native/src/connection.rs | 20 | 29 | 68.97% | ||
src/connection/simple.rs | 6 | 15 | 40.0% | ||
rsfbclient-diesel/src/fb/transaction.rs | 18 | 29 | 62.07% | ||
src/connection/mod.rs | 61 | 74 | 82.43% | ||
rsfbclient-diesel/src/fb/connection.rs | 45 | 59 | 76.27% | ||
rsfbclient-rust/src/client.rs | 22 | 36 | 61.11% | ||
rsfbclient-diesel/src/fb/types.rs | 74 | 107 | 69.16% | ||
<!-- | Total: | 643 | 757 | 84.94% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
src/connection/simple.rs | 4 | 30.39% | ||
src/transaction/simple.rs | 5 | 25.53% | ||
<!-- | Total: | 9 | --> |
Totals | |
---|---|
Change from base Build 592132101: | -0.7% |
Covered Lines: | 2480 |
Relevant Lines: | 3157 |
@fernandobatels please take a look at my changes.
I've created a default transaction on the Connection
type, so that there is no need to create and store a Transaction
in the
TransactionManager
.
Also changed the behavior of the Queryable
and Executable
methods in case the new begin_transaction
method on the Connection
was called and there is an active transaction.
Edit:. Now it only fails in the coverage, but this is probably some problem of the tarpaulin
with threaded code
@fernandobatels please take a look at my changes. I've created a default transaction on the
Connection
type, so that there is no need to create and store aTransaction
in theTransactionManager
. Also changed the behavior of theQueryable
andExecutable
methods in case the newbegin_transaction
method on theConnection
was called and there is an active transaction.
I liked the changes. Previously I thought about creating a begin_transaction
that would return a new transaction, but the idea of a default transaction is very nice.
My only concern is with the use_transaction
method. I'm afraid that this may cause some confusion with the with_transaction
method. Is it necessary to be public?
Edit:. Now it only fails in the coverage, but this is probably some problem of the
tarpaulin
with threaded code
I'm running the CI again, to see if this persists
My only concern is with the
use_transaction
method. I'm afraid that this may cause some confusion with thewith_transaction
method. Is it necessary to be public?
It can be private, as my initial idea was to use it directly in the rsfbclient-diesel
crate, but then i created the begin_transaction
, commit
and rollback
functions and forgot to remove the pub
on the use_transaction
.
I will try to find a better test that fails in the older version without using threaded code to see if tarpaulin stops complaining
I've replaced the multithreaded test with a simpler version that causes the same segfault on the version with unsafe code, hopefully tarpaulin will not complain anymore
I rebased the branch, to improve the history commits
Note: When this PR is approved, I will open a PR for the diesel
repo with my changes.
Could someone open a new PR to merge https://github.com/fernandobatels/rsfbclient/tree/diesel_split with master, and add me as reviewer? (If I create it, I can't add myself as reviewer)
It's a subset of this branch corresponding to all the non-diesel changes
Todo:
SupportsDefaultKeyword
instead the 'no-default-stmt-impl' feature