Library for Oracle database



Is there any working library for Oracle database? For connecting and writing queries like OCILIB in C for example.


As far as I checked, there is no working library for Oracle.

rustoci is under development and has not been updated two years.

I pushed rust-oracle repository three days ago. But, sorry, I have no will to
develop it further. It can select basic SQL data types: char, nchar, varchar2, nvarchar2, number,
date, timestamp, timestamp with time zone, timestamp with local time zone, interval day to second and
interval year to month.
It doesn’t support LOB, Object types, bind parameters, etc. No tests are implemented.
I started to learn Rust just a month ago. It may be non-Rusty code.

edited: I restarted rust-oracle at the beginning of Oct. 2017.


I don’t believe there is anything comparable in the rust ecosystem today, but I would consider going the FFI route.

I created a simple ocilib-sys-rs by running bindgen on ocilib.h, and adding a few directives to make it cleanly compile.

These are low level unsafe bindings, but it should be quite feasible to incrementally wrap it in a higher level safe abstraction.

You can get an idea of what you are working with by cloning that repo and running cargo doc --open. It does require nightly because of that untagged_unions directive.

If you aren’t yet familiar, you would want to read to get started. There are also numerous ffi crates on to use as examples.


Other Oracle libraries I found are:

oci_rs seems to be under development however it looks best at the present time as far as I checked their documentations and source code.

edited: rust-oracle 0.1.0 was released. I hope it is usable than oci_rs.