OceanBaseConnector 0.1.0
See the version list below for details.
dotnet add package OceanBaseConnector --version 0.1.0
NuGet\Install-Package OceanBaseConnector -Version 0.1.0
<PackageReference Include="OceanBaseConnector" Version="0.1.0" />
<PackageVersion Include="OceanBaseConnector" Version="0.1.0" />
<PackageReference Include="OceanBaseConnector" />
paket add OceanBaseConnector --version 0.1.0
#r "nuget: OceanBaseConnector, 0.1.0"
#:package OceanBaseConnector@0.1.0
#addin nuget:?package=OceanBaseConnector&version=0.1.0
#tool nuget:?package=OceanBaseConnector&version=0.1.0
OceanBaseConnector for .NET
A managed ADO.NET provider for OceanBase MySQL and Oracle compatibility modes.
The driver is experimental. Recorded database runs cover direct OceanBase 4.4.2.2 with TLS disabled; the Oracle suite still has a failed case and cleanup failure. OBProxy and other deployment profiles remain unverified. See failed tests, unsupported behavior and compatibility gaps.
Packages
| Package | Purpose |
|---|---|
OceanBaseConnector |
Connections, commands, parameters, readers and transactions. |
OceanBaseConnector.DependencyInjection |
Optional dependency injection integration. |
Both packages target netstandard2.0, netstandard2.1, net8.0, net9.0 and net10.0. Data sources and batches are available on the .NET 8/9/10 assets.
Usage
This example uses Oracle mode and a server certificate trusted by the client:
using System.Data;
using OceanBaseConnector;
using var connection = new OceanBaseConnection(
"Server=db.example;Port=2881;User ID=test_user@tenant;Password=replace-me;ExpectedMode=Oracle");
await connection.OpenAsync();
using var command = connection.CreateCommand();
command.CommandText = "select :value from dual";
var parameter = command.CreateParameter();
parameter.ParameterName = "value";
parameter.DbType = DbType.Int32;
parameter.Value = 42;
command.Parameters.Add(parameter);
var result = await command.ExecuteScalarAsync();
ExpectedMode validates the detected mode; it does not change the server mode. TLS defaults to VerifyFull, validating certificate trust and hostnames.
Every Open confirms the actual OceanBase version and tenant mode. Server features are selected
from the actual version and negotiated capabilities, without a JDBC 5/8 compatibility profile.
In MySQL mode, signed TINYINT(1) returns bool by default (nonzero is true);
set Treat Tiny As Boolean=false to read integers. UPDATE reports matched rows by default;
set Use Affected Rows=true to request changed rows. See the configuration reference.
With the DI package:
using Microsoft.Extensions.DependencyInjection;
services.AddOceanBaseConnection(connectionString);
Each resolution creates a closed transient connection owned by its container scope. On .NET 8/9/10, AddOceanBaseDataSource and AddKeyedOceanBaseDataSource register singleton data sources; callers dispose the connections they create.
Features and limits
- Synchronous and asynchronous SQL, server-prepared parameters, multiple results, streaming reads and binary uploads.
- Local transactions; .NET 8/9/10 assets also expose savepoints and sequential batches.
- Oracle extensions include stored procedures, OUT parameters, REF CURSOR, LOB locators, complex types and array binding. Procedures and output parameters require
Use Oracle Prepare Execute=true; locator LOBs also requireUse Lob Locators=true. - Explicit XA, multiple server addresses, custom address resolution, logging, tracing and metrics.
- Connection pooling and ambient
TransactionScopeare not supported.Pooling=trueis rejected. - Every connection confirms
ob_version()and the tenant compatibility mode; MySQL-mode opens also require@@autocommitenabled, rejecting sessions whose implicit transactions this provider could not commit. Recognized version formats are accepted; versions beyond the recorded deployment and OBProxy still need real-server validation.
The driver does not automatically replay SQL. If OceanBaseException.IsExecutionOutcomeUnknown is true, reconcile the operation before retrying a write or commit. Batches run sequentially and need an explicit transaction for atomicity. Dispose readers, commands and connections; closing an unread reader can destroy its session.
Build and test
Requires the .NET 10 SDK. Tests run on .NET 10. Real-database integration tests never run in CI or a plain dotnet test; they need an explicit opt-in and a configured environment (integration guide).
dotnet restore OceanBaseConnector.slnx
dotnet build OceanBaseConnector.slnx -c Release --no-restore
dotnet test OceanBaseConnector.slnx -c Release --no-build --no-restore
dotnet pack OceanBaseConnector.slnx -c Release --no-build --no-restore -o TestResults/packages
To check package consumption, run pwsh -File eng/Verify-Packages.ps1 -PackageDirectory TestResults/packages. This requires PowerShell 7.1+ and .NET/ASP.NET Core 8/9/10 runtimes.
CI/CD and releases
The workflow builds and tests on Windows and Linux for pull requests targeting main/master, pushes to those branches, and tag pushes.
| Event | Build and test | Pack and verify NuGet consumers | Publish to NuGet and GitHub Releases |
|---|---|---|---|
Pull request to main/master |
Yes | No | No |
Push to main/master |
Yes | Yes | No |
| Version tag push | Yes | Yes | Yes, after both operating systems pass |
| Other branch push | No | No | No |
Packages are built from the two projects under src/, verified on Windows, and retained as the nuget-packages workflow artifact. Tag publication downloads these same packages without rebuilding them. Real database credentials are not required by this workflow.
To release, update the shared Version in Directory.Build.props, commit it, and push a matching tag such as v0.1.0 (or 0.1.0). A mismatched tag fails before building or publishing. Prerelease versions such as v0.2.0-rc.1 create a GitHub prerelease. Configure the repository Actions secret NUGET_API_KEY with permission to publish both package IDs; the workflow uses GITHUB_TOKEN with contents: write to create the GitHub Release.
Each release records the non-merge commits since the previous reachable version tag, a comparison link, and install commands for both packages. The first release includes the initial commit history. These notes and the verified .nupkg files are attached to the GitHub Release; each NuGet package's release notes link to it. Notes are generated from Git history, so use descriptive commit subjects. This does not replace the outstanding publication review in the verification status.
Check notes generation locally with pwsh -File eng/Test-ReleaseNotes.ps1. To preview an existing tag, check out that tag and run pwsh -File eng/New-ReleaseNotes.ps1 -Tag v0.1.0; the output defaults to TestResults/packages/RELEASE_NOTES.md.
Documentation
- Compatibility and known limitations
- Database acceptance guide
- Integration test guide
- API reference
- Verification status and remaining work
- Connector/J architecture reference
License
MIT. See third-party notices.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. 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 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 is compatible. 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 is compatible. |
| .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. |
-
.NETStandard 2.0
- BouncyCastle.Cryptography (>= 2.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.0)
-
.NETStandard 2.1
- BouncyCastle.Cryptography (>= 2.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- System.Diagnostics.DiagnosticSource (>= 8.0.0)
-
net10.0
- BouncyCastle.Cryptography (>= 2.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
-
net8.0
- BouncyCastle.Cryptography (>= 2.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
-
net9.0
- BouncyCastle.Cryptography (>= 2.7.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on OceanBaseConnector:
| Package | Downloads |
|---|---|
|
OceanBaseConnector.DependencyInjection
Dependency injection integration for the unified OceanBase ADO.NET provider. |
|
|
SharpAbp.Abp.Dapper.OceanBase
SharpAbp Dapper OceanBase Module |
|
|
SharpAbp.Abp.Data.SqlBuilder.OceanBase
SharpAbp Data SqlBuilder OceanBase Module |
|
|
Sharp.OceanBase.EntityFrameworkCore
Entity Framework Core provider for OceanBase MySQL and Oracle compatibility modes. |
GitHub repositories
This package is not used by any popular GitHub repositories.