Available

amalgame-oracle

Oracle Database via Instant Client (OCI), with bound parameters and transactions.

amc package add oracle GitHub ↗ ← Back to the ecosystem

Overview

Dynamic-link binding to the Oracle Instant Client (OCI). Since the Oracle wire protocol is proprietary, the package links to Oracle's official library (libclntsh) — separate download, Oracle license terms. Works with the Oracle Database releases your Instant Client supports (typically 19c, 21c, 23ai); tested in CI against Oracle XE 21.

Features

  • ✓Binding to libclntsh (Oracle Instant Client: Basic and SDK packages)
  • ✓:1, :2 parameters with ExecBind / QueryBindAll, Begin / Commit / Rollback transactions
  • ✓Easy Connect (//host:1521/service) or TNS alias
  • ✓Dynamic-link pattern — no vendored fork to maintain

Planned

  • ◐OCI session pool
  • ◐PL/SQL OUT / INOUT parameters
  • ◐Streamed LOB reads: today CLOB and BLOB values are cut at 4000 bytes
  • ◐Typed column accessors

Example

Minimal usage example — copy-paste runnable after install.

import Amalgame.Database.Oracle

public class Program {
    public static void Main() {
        let db = Oracle.Open("app", "secret", "//db.example.com:1521/ORCLPDB1")
        if (!Oracle.IsOpen(db)) {
            Console.WriteLine("connect failed: " + Oracle.LastError(db))
            return
        }
        let params = new List<string>()
        params.Add("42")
        let rows = Oracle.QueryBindAll(db, "SELECT id, total FROM orders WHERE customer_id = :1", params)
        for row in rows {
            Console.WriteLine(row.Get(0) + " : " + row.Get(1))
        }
        Oracle.Close(db)
    }
}

At a glance

Related packages