Linger.DataAccess.Oracle 0.8.2-preview

This is a prerelease version of Linger.DataAccess.Oracle.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Linger.DataAccess.Oracle --version 0.8.2-preview
                    
NuGet\Install-Package Linger.DataAccess.Oracle -Version 0.8.2-preview
                    
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="Linger.DataAccess.Oracle" Version="0.8.2-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Linger.DataAccess.Oracle" Version="0.8.2-preview" />
                    
Directory.Packages.props
<PackageReference Include="Linger.DataAccess.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 Linger.DataAccess.Oracle --version 0.8.2-preview
                    
#r "nuget: Linger.DataAccess.Oracle, 0.8.2-preview"
                    
#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 Linger.DataAccess.Oracle@0.8.2-preview
                    
#: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=Linger.DataAccess.Oracle&version=0.8.2-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Linger.DataAccess.Oracle&version=0.8.2-preview&prerelease
                    
Install as a Cake Tool

Linger.DataAccess.Oracle

δΈ­ζ–‡ | English

Overview

Linger.DataAccess.Oracle is a secure and feature-rich Oracle database access library designed for enterprise applications. It provides enhanced security through parameterized queries, preventing SQL injection attacks, and offers comprehensive database operations with async support.

Features

  • πŸ”’ Security First: All queries use parameterized statements to prevent SQL injection
  • ⚑ High Performance: Batch processing with intelligent pagination (1000 items per batch)
  • πŸ”„ Async Support: Full async/await support with CancellationToken
  • 🎯 Multi-Framework: Supports .NET 9.0, .NET 8.0, and .NET Framework 4.6.2
  • πŸ“Š Comprehensive Operations: Complete CRUD operations with advanced features
  • πŸ§ͺ Well Tested: Comprehensive unit test coverage (28+ test methods)

Installation

<PackageReference Include="Linger.DataAccess.Oracle" Version="0.8.0-preview" />

Quick Start

using Linger.DataAccess.Oracle;

// Initialize Oracle helper
var oracle = new OracleHelper("Data Source=localhost:1521/XE;User Id=hr;Password=password;");

// Secure parameterized query
var users = await oracle.QueryAsync<User>("SELECT * FROM users WHERE department = :dept", 
    new OracleParameter(":dept", "IT"));

// Batch processing with automatic pagination
var userIds = new List<string> { "1", "2", "3", ..., "5000" }; // Large list
var results = oracle.Page("SELECT * FROM users WHERE id IN ({0})", userIds);

// Check existence safely
bool exists = await oracle.ExistsAsync("SELECT 1 FROM users WHERE email = :email",
    new OracleParameter(":email", "user@example.com"));

Core Methods

Batch Operations

  • Page(sql, parameters) - Intelligent batch processing for large parameter lists
  • PageAsync(sql, parameters, cancellationToken) - Async batch processing

Existence Checks

  • Exists(sql, parameters) - Parameterized existence verification
  • ExistsAsync(sql, parameters, cancellationToken) - Async existence checks

Query Operations

  • Query<T>(sql, parameters) - Strongly typed parameterized queries
  • QueryAsync<T>(sql, parameters, cancellationToken) - Async typed queries

Security Features

SQL Injection Prevention

// ❌ Vulnerable (old approach)
var sql = $"SELECT * FROM users WHERE name = '{userName}'";

// βœ… Secure (parameterized)
var sql = "SELECT * FROM users WHERE name = :userName";
var result = oracle.Query<User>(sql, new OracleParameter(":userName", userName));

Parameter Validation

All methods include comprehensive parameter validation:

  • Null reference checks
  • Empty string validation
  • Type safety enforcement

Performance Optimizations

Automatic Batching

Large parameter lists are automatically split into batches of 1000 items:

// Handles 10,000+ IDs efficiently
var massiveIdList = Enumerable.Range(1, 10000).Select(i => i.ToString()).ToList();
var results = oracle.Page("SELECT * FROM users WHERE id IN ({0})", massiveIdList);
// Automatically processes in 10 batches of 1000 items each

Async Operations

All database operations support cancellation:

using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var users = await oracle.QueryAsync<User>("SELECT * FROM users", cancellationToken: cts.Token);

Dependencies

  • Oracle.ManagedDataAccess.Core 23.9.1 (.NET 8.0, .NET 9.0)
  • Oracle.ManagedDataAccess 21.19.0 (.NET Framework 4.6.2)
  • Linger.DataAccess (Core abstractions)

Testing

Comprehensive unit test suite with 28+ test methods covering:

  • SQL injection prevention
  • Parameter validation
  • Batch processing
  • Async operations
  • Error handling
dotnet test Linger.DataAccess.Oracle.UnitTests

Best Practices

  1. Always use parameterized queries
  2. Implement proper disposal patterns
  3. Use async methods for I/O operations
  4. Handle cancellation tokens appropriately
  5. Validate inputs before database calls

License

This project is part of the Linger framework ecosystem.

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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
0.9.5 35 9/28/2025
0.9.4-preview 111 9/25/2025
0.9.3-preview 143 9/22/2025
0.9.2-preview 143 9/21/2025
0.9.1-preview 249 9/16/2025
0.9.0-preview 76 9/12/2025
0.8.5-preview 143 8/31/2025
0.8.4-preview 255 8/25/2025
0.8.3-preview 117 8/20/2025
0.8.2-preview 155 8/4/2025
0.8.1-preview 96 7/30/2025
0.1.2-alpha 80 12/17/2024
0.1.1-alpha 74 12/17/2024
0.1.0-alpha 76 12/6/2024
0.0.2-alpha 70 10/3/2024