Closed a3pelawi closed 4 years ago
are you using cargo?
please try replacing your rsfbclient
dependency in Cargo.toml
as follows
[dependencies]
rsfbclient = { version = "0.11.0", default_features = false, features = ["dynamic_loading","date_time"] }
and retry. Please report back with the result.
what's probably happening: the linking
feature is enabled by default for rsfbclient
, in your case causing the crate to look for the lib at link time and not finding it in the default library search paths of your system
(advanced) if you want to play around with dynamic linking (instead of dynamic loading) you could use the *LIBRARY_PATH
environment variables at build time and at run time and use linking
feature instead of dynamic_loading
feature for rsfbclient
(or you can also use both at the same time).
on MacOS I think they are:
DYLD_LIBRARY_PATH
DYLD_FALLBACK_LIBRARY_PATH*
LIBRARY_PATH
for which information is readily available elsewhere
regardless of what method you use, you may also need to set the environment variable FIREBIRD
to the path where firebird.conf
is found in order to use the embedded engine.
if you are using firebird version < 3.0, embedded might not work at all, but if you have a locally running server, libfbclient.dylib
can fall back to that automatically and work correctly in some circumstances
i think we will try to improve this situation in the future, it's definitely a bad out-of-the-box experience.
Yes, I'm using cargo. And firebird 3.0.3. Everything is ok, I have try using Qt5 and DB Manager DBEaver, and work fine.
Ok. i'll try your advice. Sorry for my english Thanx sir 👍
I have test it, and everything running well 💯 This my code,
use rsfbclient::{prelude::*, ConnectionBuilder, FbError};
fn main() -> Result<(), FbError> { let mut conn = ConnectionBuilder::pure_rust() .host("localhost") .db_name("/Path_your_db/db_test.fdb") .user("SYSDBA") .pass("masterkey") .connect()?;
let rows: Vec<(String, String, f32, i32)> = conn.query("select kode, ket, nilai, qty from tb_test", ())?;
for r in rows {
println!("{:?}", r);
}
Ok(())
}
And for Cargo.toml
[dependencies] rsfbclient = { version = "0.11.0", default_features = false, features = ["pure_rust", "date_time"] }
Thanx sir 👍