fernandobatels / rsfbclient

Rust Firebird Client
MIT License
76 stars 11 forks source link

Transaction configuration #136

Closed fernandobatels closed 2 years ago

fernandobatels commented 2 years ago

Now we can customize the transaction behavior of our crate.

Like others builder options, we just need to call the with_transaction. With this method the user can access the TransactionConfigurationBuilder and setup what they need.

This method setup the default configuration, but the user also can choose a new configuration for a specific transaction.

fernandobatels commented 2 years ago

@datiscum can you check this PR? Does the implementation solve your problem in #135 ?

datiscum commented 2 years ago

Yes, thank you! If I now set the transaction parameters as they are set in the GUI app, the query no longer hangs. My connect:

let mut conn = rsfbclient::builder_native()
    .with_dyn_link()
    .with_remote()
    .host("192.168.11.22")
    .db_name("/DB/EventTest.fdb")
    .user("SYSDBA")
    .pass("!master?")
    .transaction(TransactionConfiguration {
      lock_resolution: TrLockResolution::NoWait,
      isolation: TrIsolationLevel::ReadCommited(TrRecordVersion::RecordVersion),
      data_access: TrDataAccessMode::ReadWrite
  })
    .connect()?;
coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 3234652343


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/connection/builders/builder_pure_rust.rs 0 2 0.0%
src/connection/builders/builder_native.rs 2 5 40.0%
rsfbclient-native/src/connection.rs 7 11 63.64%
<!-- Total: 70 79 88.61% -->
Files with Coverage Reduction New Missed Lines %
src/transaction/simple.rs 1 23.4%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 3049490793: -23.5%
Covered Lines: 1018
Relevant Lines: 1869

💛 - Coveralls