Delly.DBunny.Oracle 2026.5.7

dotnet add package Delly.DBunny.Oracle --version 2026.5.7
                    
NuGet\Install-Package Delly.DBunny.Oracle -Version 2026.5.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Delly.DBunny.Oracle" Version="2026.5.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Delly.DBunny.Oracle" Version="2026.5.7" />
                    
Directory.Packages.props
<PackageReference Include="Delly.DBunny.Oracle" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Delly.DBunny.Oracle --version 2026.5.7
                    
#r "nuget: Delly.DBunny.Oracle, 2026.5.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Delly.DBunny.Oracle@2026.5.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Delly.DBunny.Oracle&version=2026.5.7
                    
Install as a Cake Addin
#tool nuget:?package=Delly.DBunny.Oracle&version=2026.5.7
                    
Install as a Cake Tool

Delly.DBunny.Oracle

License .NET AOT Compatible

Oracle provider implementation for DBunny. Supports Oracle Database 11g and later.

Installation

dotnet add package Delly.DBunny.Oracle

Quick Start

using Delly.DBunny;
using Delly.DBunny.Oracle;
using Delly.DBunny.Sql.Extension;
using Delly.DBunny.Connecting.Extension;
using System.Data.Common;

// Create connection using builder
var connectionDefine = new OracleConnectionDefine()
    .WithDataSource("localhost:1521/ORCL")
    .WithUserId("system")
    .WithPassword("password");

var descriptor = connectionDefine.GetDbConnectionDescriptor(
    OracleConnectionDefine.DATABASE_TYPE, "Default");

var provider = new OracleProvider();
using var connection = provider.GetDbConnection(descriptor.ConnectionString);
connection.Open();

// Create a table
var columnDescriptors = new List<DbColumnDesciptor>
{
    new DbColumnDesciptor { ColumnName = "Id", ColumnType = "NUMBER(10)", PrimaryKeyFlag = true, NullableFlag = false },
    new DbColumnDesciptor { ColumnName = "Name", ColumnType = "VARCHAR2(100)", PrimaryKeyFlag = false, NullableFlag = false },
    new DbColumnDesciptor { ColumnName = "Age", ColumnType = "NUMBER(10)", PrimaryKeyFlag = false, NullableFlag = true }
};
var createTableSql = provider.SqlProvider.CreateTable(string.Empty, "Users", columnDescriptors);

using var createCommand = provider.GetDbCommand(connection);
createCommand.CommandText = createTableSql.Sql;
await createCommand.ExecuteNonQueryAsync();

// Insert data
var insertSql = new Sqled("INSERT INTO \"Users\" (Name, Age) VALUES (:name, :age)")
    .Set("name", "John Doe")
    .Set("age", 30);

using var insertCommand = provider.GetDbCommand(connection);
insertCommand.CommandText = insertSql.Sql;
provider.SetParameters(insertCommand, insertSql.Parameters);
await insertCommand.ExecuteNonQueryAsync();

// Query data
var selectSql = new Sqled("SELECT * FROM \"Users\" WHERE Age > :minAge")
    .Set("minAge", 18);

await provider.ReadAsync(connection, selectSql, async reader =>
{
    while (await reader.ReadAsync())
    {
        var id = reader["Id"];
        var name = reader["Name"];
        var age = reader["Age"];
        Console.WriteLine($"Id: {id}, Name: {name}, Age: {age}");
    }
});

Connection Builder

Use the fluent builder for connection configuration:

using Delly.DBunny.Oracle;
using Delly.DBunny.Connecting.Extension;

var connectionDefine = new OracleConnectionDefine()
    .WithDataSource("localhost:1521/ORCL")
    .WithUserId("system")
    .WithPassword("password")
    .WithConnectionTimeout(30)
    .WithPooling(true)
    .WithMinPoolSize(0)
    .WithMaxPoolSize(100);

var descriptor = connectionDefine.GetDbConnectionDescriptor(
    OracleConnectionDefine.DATABASE_TYPE, "Default");

Connection Parameters

Parameter Default Description
Data Source - Oracle data source (host:port/service or TNS name)
User Id - Username
Password - Password
Connection Timeout 30 Connection timeout in seconds
Pooling True Enable connection pooling
Min Pool Size 0 Minimum pool size
Max Pool Size 100 Maximum pool size

Oracle Features

  • No Database Layer: Oracle doesn't support database-level operations at SQL level
  • Schema Layer: Full schema support (schema = user)
  • Name Quoting: Uses double quotes "name"
  • Parameter Prefix: :
  • Sequences: Uses sequences for auto-incrementing columns (SEQUENCE + TRIGGER)
  • Type Mapping:
    • Boolean → NUMBER(1)
    • Byte, SByte → NUMBER(3)
    • Int16, UInt16 → NUMBER(5)
    • Int32, UInt32 → NUMBER(10)
    • Int64, UInt64 → NUMBER(19)
    • Single → BINARY_FLOAT
    • Double → BINARY_DOUBLE
    • Decimal → NUMBER
    • DateTime → TIMESTAMP
    • String (<=4000 chars) → VARCHAR2
    • String (>4000 chars) → CLOB

Data Source Format

The Data Source parameter can be specified in several ways:

Easy Connect Format

// host:port/service
.WithDataSource("localhost:1521/ORCL")

// Using SID (legacy)
.WithDataSource("localhost:1521:XE")

TNS Names

If you have a tnsnames.ora file configured, use the TNS alias:

.WithDataSource("ORCL")

Full Connection Descriptor

.WithDataSource("(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)))")

Schema in Oracle

In Oracle, each user has their own schema. When you connect with a user, you're working in that user's schema by default.

// Get tables in current schema (user)
var tables = await provider.GetTables(connection, string.Empty);

// Get tables in specific schema
var tables = await provider.GetTables(connection, "OTHER_USER");

Auto-Increment Columns

Oracle doesn't have native AUTO_INCREMENT like MySQL. Instead, you use sequences:

// Create a sequence first
await ExecuteNonQueryAsync(connection, "CREATE SEQUENCE seq_users_id START WITH 1 INCREMENT BY 1");

// Then create table with default value
await ExecuteNonQueryAsync(connection, "INSERT INTO \"Users\" (Id, Name) VALUES (seq_users_id.NEXTVAL, 'John')");

Dependencies

License

MIT License

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.5.7 96 5/19/2026
2026.5.6 93 5/19/2026
2026.5.5 92 5/18/2026
2026.5.4 93 5/18/2026
2026.5.3 97 5/18/2026
2026.5.2 91 5/17/2026