Read, write, upsert, and alter Oracle Database tables through a Rust ADBC driver, with no Oracle client
Compatibility Matrix
This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
|---|---|---|---|---|---|
| Linux AMD64 | |||||
| Linux ARM64 | |||||
| macOS AMD64 | |||||
| macOS ARM64 | |||||
| Windows AMD64 | |||||
| Windows ARM64 | |||||
| WebAssembly |
Installing and Loading
INSTALL orkidea FROM community;
LOAD orkidea;
Example
-- Store the connection in a secret (or use CONNECT_STRING with a TNS alias)
CREATE SECRET ora (
TYPE orkidea,
HOST 'db.example.com', PORT 1521, SERVICE 'FREEPDB1',
USER 'scott', PASSWORD 'tiger'
);
-- Attach the database: filters, projections, LIMIT, and top-N run in Oracle
ATTACH 'ora' AS ora (TYPE orkidea);
SELECT ename, sal FROM ora.emp WHERE deptno = 10 ORDER BY sal DESC LIMIT 5;
-- Write to it, inside DuckDB transactions
CREATE TABLE ora.top_earners AS SELECT * FROM ora.emp WHERE sal > 3000;
UPDATE ora.emp SET sal = sal * 1.1 WHERE deptno = 20;
INSERT INTO ora.dept VALUES (50, 'RESEARCH', 'BOSTON') ON CONFLICT DO NOTHING;
-- Or run Oracle SQL directly
FROM orkidea_query('ora', 'SELECT * FROM v$version');
FROM orkidea_execute('ora', 'BEGIN dbms_stats.gather_table_stats(USER, ''EMP''); END;');
About orkidea
Orkidea makes an Oracle schema behave like a DuckDB database you can
change, not just read: INSERT, CREATE TABLE ... AS, UPDATE,
DELETE, RETURNING, ON CONFLICT, INSERT OR REPLACE, MERGE INTO,
CREATE/DROP TABLE, and ALTER TABLE (add, drop, and rename columns,
change types, defaults, NOT NULL, primary keys), all inside DuckDB
transactions that commit or roll back on Oracle. Defaults and identity
columns are left to Oracle, and RETURNING gives the rows as Oracle
stored them.
It is built on the Orkidea ADBC driver,
a standalone Rust implementation of Oracle's network protocol that is
linked into the extension, so there is no Instant Client, OCI, or ODBC to
install. Results stream into DuckDB as Arrow record batches with exact
types (NUMBER(p,s) as DECIMAL, TIMESTAMP WITH TIME ZONE as
TIMESTAMPTZ, LOBs, intervals, JSON, and VECTOR).
-
Secrets: host/port/service, connect strings,
tnsnames.oraaliases, wallets, and TLS. -
ATTACH: filters, projections,
LIMIT, and top-N queries are pushed down to Oracle. - Parallel scans: large tables are read by several sessions over ROWID ranges at one SCN, so the result is a consistent snapshot.
- Federation: join Oracle with Postgres, Parquet, or any other source DuckDB reads.
-
orkidea_queryandorkidea_executerun Oracle SQL and PL/SQL.
Not affiliated with, sponsored by, or endorsed by Oracle Corporation.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| orkidea_execute | table | NULL | NULL | |
| orkidea_oracle_default | scalar | NULL | NULL | |
| orkidea_query | table | NULL | NULL | |
| orkidea_version | scalar | NULL | NULL |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases | typed_value |
|---|---|---|---|---|---|
| orkidea_parallel_scan | How many Oracle sessions one scan of an attached table may read through at once: -1 chooses (DuckDB's thread count, up to 8), 0 or 1 reads through one session | BIGINT | GLOBAL | [] | -1 |
| orkidea_parallel_scan_min_rows | Oracle tables with fewer rows than this (by their optimizer statistics) are read through one session | UBIGINT | GLOBAL | [] | 500000 |
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |