launchbadge / sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
Apache License 2.0
13.23k stars 1.25k forks source link

Introduce support for Oracle #175

Open mehcode opened 4 years ago

mehcode commented 4 years ago

https://oracle.github.io/odpi/

juarezr commented 4 years ago

As one of the objectives of SQLx is Pure Rust source code, writing a driver for connecting to Oracle may be harder without breaking this rule because of there is a need for using Oracle Instant Client libraries.

Although ODPI-C is an open source, this C library just simplifies the use by wrapping Oracle Call Interface (OCI).

OCI requires a local install/deploy of Oracle Instant Client. I don't know if a open source or reverse engineered exists or may be legal in some countries.

For example cx_Oracle python driver docs contains instructions for installing Oracle Instant Client.

Also the rust crates Rust-oracle, Sibyl, oci_rs tell to setup Oracle Instant Client as requirement.

Because of this, maybe it would be better first develop support for ODBC because:

  1. Support for ODBC will provide access to a number of databases and platforms because the majority of database products have a stable a mature ODBC driver.
  2. Will take ages for writing a native driver for each database product existing today.
  3. Sometimes client protocols for some database changes and this would require additional maintenance effort.
  4. Nothing blocks further development of native drivers that could be more secure and performant.
  5. Type-safe SQL could be evaluated do a subset of ANSI SQL that is safely supported by most of databases.
ScottHuangZL commented 3 years ago

What's is current plan? Support most of database through ODBC firstly? Thanks.

abonander commented 3 years ago

Oracle support is still coming but will be provided through our planned paid premium support offering (open-source projects and non-profit organizations will be able to apply for a free license). See https://github.com/launchbadge/sqlx/discussions/909 for details.