Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 99 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ let ctx = SessionContext::with_state(state);

- PostgreSQL
- MySQL
- Oracle
- SQLite
- ClickHouse
- DuckDB
Expand Down Expand Up @@ -165,6 +166,57 @@ EOF
cargo run -p datafusion-table-providers --example mysql --features mysql
```

### Oracle

In order to run the Oracle example, you need to have an Oracle database server running. You can use the following command to start an Oracle Free server in a Docker container the example can use:

```bash
docker run --name oracle-free \
-e ORACLE_PASSWORD=OraclePassword123 \
-p 1521:1521 \
-d gvenzl/oracle-free:latest

# Wait for the Oracle server to start and healthcheck to pass
echo "Waiting for Oracle to start (this may take 1-2 minutes)..."
until docker exec oracle-free /usr/local/bin/checkHealth.sh >/dev/null 2>&1; do
sleep 5
done
echo "Oracle is ready!"

# Create a table in the Oracle server and insert some data
docker exec -i oracle-free sqlplus system/OraclePassword123@FREEPDB1 <<EOF
CREATE TABLE companies (
id NUMBER PRIMARY KEY,
name VARCHAR2(100)
);

INSERT INTO companies (id, name) VALUES (1, 'Acme Corporation');
INSERT INTO companies (id, name) VALUES (2, 'Widget Inc.');
COMMIT;
EXIT;
EOF
```

**Prerequisites:** The `rust-oracle` crate requires Oracle Instant Client libraries (ODPI-C). Install them:

- **Linux (Debian/Ubuntu):**
```bash
apt-get install libaio1 wget unzip
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip
unzip instantclient-basiclite-linuxx64.zip -d /opt/oracle
export LD_LIBRARY_PATH=/opt/oracle/instantclient_XX_X:$LD_LIBRARY_PATH
```

- **macOS:**
```bash
brew install instantclient-basic
```

```bash
# Run from repo folder
cargo run -p datafusion-table-providers --example oracle --features oracle
```

### Flight SQL

```bash
Expand Down
10 changes: 10 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ rust_decimal = { version = "1.38.0", features = ["db-postgres"] }
adbc_driver_manager = { workspace = true, optional = true }
adbc_core = { workspace = true, optional = true }
r2d2_adbc = { version = "0.2.0", optional = true }
oracle = { version = "0.6", optional = true }
bb8-oracle = { version = "0.3", optional = true }

[dev-dependencies]
anyhow = "1.0"
Expand Down Expand Up @@ -167,6 +169,14 @@ adbc = [
"dep:r2d2",
]
adbc-federation = ["adbc", "federation"]
oracle = [
"dep:oracle",
"dep:bb8",
"dep:bb8-oracle",
"dep:async-stream",
"dep:arrow-schema",
]
oracle-federation = ["oracle", "federation"]

# docs.rs-specific configuration
[package.metadata.docs.rs]
Expand Down
2 changes: 2 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub mod flight;
pub mod mysql;
#[cfg(feature = "odbc")]
pub mod odbc;
#[cfg(feature = "oracle")]
pub mod oracle;
#[cfg(feature = "postgres")]
pub mod postgres;
#[cfg(feature = "sqlite")]
Expand Down
Loading