fernandobatels / rsfbclient

Rust Firebird Client
MIT License
76 stars 11 forks source link

Use `listen_event` from a SimpleConnection #149

Closed fernandobatels closed 1 year ago

fernandobatels commented 1 year ago

Discussed in https://github.com/fernandobatels/rsfbclient/discussions/148

Originally posted by **tombowditch** October 30, 2023 Hello, I am converting my `Connection>` into a `SimpleConnection` so I can wrap it in a internal db client. I'm trying to now use events; but unable to. `.listen_event` is available on `Connection>` (`conn1` below) but seemingly not on the same `SimpleClient` (`c1` below): ![CleanShot 2023-10-30 at 17 47 20](https://github.com/fernandobatels/rsfbclient/assets/5332144/36df42ff-fd65-405f-81c1-5b8c6ecc50c7) Is this expected? Full code: ```rust let conn = rsfbclient::builder_native() .with_dyn_load( "/Library/Frameworks/Firebird.framework/Versions/A/Libraries/libfbclient.dylib", ) .with_remote() .db_name("xxxxxxxxxxxxx") .host("xxxxxxxxxx") .transaction(TransactionConfiguration { lock_resolution: TrLockResolution::NoWait, ..TransactionConfiguration::default() }) .connect()?; conn.listen_event("HELLO".into(), |c| Ok(true)); let c1: SimpleConnection = conn.into(); c1.listen_event("HELLO1", |c| Ok(true)); // <-- errors ```
fernandobatels commented 1 year ago

@tombowditch, please check the new released version: 0.32.2