The production release of Oracle Database Programming Interface for C (ODPI-C) is now available on GitHub.
ODPI-C is an open source library of C code that simplifies access to Oracle Database for applications written in C or C++.
ODPI-C is a wrapper over Oracle Call Interface. OCI is Oracle Database's main C API and is widely used by our products and user applications so it is stable, fast, scalable and supported. OCI's API is extremely flexible and gives fine-grained control to the developer for a very wide range of use cases.
ODPI-C is also flexible but is aimed primarily at language interface creators. These creators are programming within the confines of a scripting language's type system and semantics. The languages often expose simplified data access to users through cross-platform, common-denominator APIs. Therefore it makes sense for ODPI-C to provide easy to use functionality for common data access, while still allowing the power of Oracle Database to be used.
Of course ODPI-C isn't just restricted to language interface usage. Since it provides a simple programming experience, if ODPI-C has the functionality you need for accessing Oracle Database, then you can add it to your own projects.
ODPI-C is developed by the Oracle Database Data Access team, who also look after OCI and other language APIs for Oracle Database. Anthony Tuininga has been leading the ODPI-C effort. He has made full use of his extensive knowledge as creator and maintainer of the extremely popular, and full featured, Python cx_Oracle interface.
A big thank you to all the users who have given feedback on ODPI-C pre-releases.
The ODPI-C feature list currently includes all the normal calls you'd expect to manage connections and to execute SQL and PL/SQL efficiently. It also has such gems as SQL and PL/SQL object support, scrollable cursors, Advanced Queuing, and Continuous Query Notification. ODPI-C does extra validation and has a reference counting mechanism for resiliency to help stop applications destroying in-use OCI resources. Writing threaded mode applications is easier.
The Oracle feature list in this initial release, in no particular order, is:
In case you want to access other OCI functionality without having to modify ODPI-C code, there is a call to get the underlying OCI Service Context handle.
ODPI-C applications can take advantage of OCI features which don't require API access, such as the oraaccess.xml configuration for enabling statement cache auto-tuning. Similarly, Oracle Database features controlled by SQL and PL/SQL, such as partitioning, can be used in applications, as you would expect.
Since communication to the database is handled by Oracle's Network Services, features such as encrypted communication and LDAP can easily be configured.
See ODPI-C Installation for detailed instructions.
ODPI-C code can be included in your C or C++ applications and compiled like any OCI application. Or, if you want to use ODPI-C as a shared library, use the provided example Makefile.
ODPI-C makes it easy to build and distribute application code or binaries because it is open source, and OCI headers and libraries are not needed at compilation. Applications need standard Oracle client libraries only at run time.
Oracle client libraries must be installed separately. Version 11.2, 12.1 or 12.2 are required. These allow applications to connect to Oracle Database 9.2 or later (depending on the client version).
ODPI-C uses the shared library loading mechanism available on each supported platform to load the Oracle Client library at run time. This allows code using ODPI-C to be built only once, and then run using available Oracle Client libraries.
Oracle client libraries are available in the free, easily installed Oracle Instant Client "Basic" and "Basic Light" packages. Client libraries are also available in any Oracle Database installation, or in the full Oracle Client installation.
ODPI-C has been tested on Windows, macOS and Linux. Compilation on other platforms such as AIX and Solaris x64 is possible, but these have not been fully tested.
ODPI-C provides an API to Oracle Database that enables functional, flexible application and scripting language API development.
ODPI-C is being used by us for the Python cx_Oracle 6 interface, and in node-oracledb 2 for Node.js. Third party developers have also started Go and Rust interfaces too. These code bases are handy, bigger examples of how to use ODPI-C.
It's also pleasing to have gotten positive feedback from internal Oracle projects that have adopted ODPI-C for a variety of other application development purposes.
ODPI-C will continue to be enhanced, bringing great Oracle Database technologies to developers. Scripting language drivers will similarly see enhancements and get benefits of the common ODPI-C code base.
I think you'll be pleased with our direction and plans for developers and scripting languages in 2017.
Home page: https://oracle.github.io/odpi/
Report issues and discuss: https://github.com/oracle/odpi/issues
Why is this first production release called version 2? Because ODPI-C is a significantly updated, refactored, and standalone release of code which had origins in a node-oracledb 1.x. abstraction layer.