Library for Oracle database


#1

Hello,

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


#2

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

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

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

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.


#3

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 https://doc.rust-lang.org/book/ffi.html to get started. There are also numerous ffi crates on crates.io to use as examples.


#4

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.