Db2
This page contains the latest information of the releases of RepoDb.Db2 library.
View the NuGet package here or download it directly here.
RepoDb.Db2 (v1.16.0)
Released: September 9, 2026
Version bump only, aligning with the RepoDB ecosystem-wide v1.16.0 release — no functional changes since v1.0.0.
- Referenced the
RepoDbpackagev1.16.0.
RepoDb.Db2 (v1.0.0)
Released: September 8, 2026
First general availability (non-preview) release of the Db2 provider, promoting the v0.0.1-beta2 preview below to stable. No functional changes since v0.0.1-beta2 — see that entry (and v0.0.1-alpha further below) for the full changelog and known limitations.
RepoDb.Db2 (v0.0.1-beta2) - Preview
Released: August 23, 2026
New
- Added TypeToDb2TypeResolver, an IResolver
<Type, DB2Type>implementation that resolves a .NET CLRTypeinto its equivalentDB2Type. Used internally by Db2BulkArrayBinder (see the RepoDb.Db2.BulkOperations release notes) to infer a bound parameter’sDB2Typewhen no explicit mapping is given. - Referenced the
RepoDbpackagev1.16.0-beta2.
RepoDb.Db2 (v0.0.1-alpha) - Preview
Released: August 10, 2026
New
First (alpha) release of the Db2 provider for RepoDB, built on top of the IBM Data Server .NET Provider (Net.IBM.Data.Db2). Targets Db2 for Linux, UNIX, and Windows (LUW) 10.5 and later, and .NET 8, .NET 9, and .NET 10.
What’s included
- Db2Bootstrap / Db2GlobalConfiguration
.UseDb2()— initializes RepoDB for use withDB2Connection(GlobalConfiguration.Setup().UseDb2()), mapping the Db2DbSetting, Db2DbHelper, and Db2StatementBuilder to everyDB2Connection. - Db2DbSetting — Db2-specific behavior:
"for opening/closing identifier quotes,:parameter prefix, no table hints, no native upsert (Merge is hand-built instead), and multi-statement command text support (IsMultiStatementExecutable = true,MultiStatementSeparator = ";"). - Db2StatementBuilder — generates Db2-flavored SQL for every operation:
OFFSET ... FETCH NEXT ... ROWS ONLYpaging for BatchQuery/skip-take queries,FETCH FIRST n ROWS ONLYfor Exists and top-N Query,MERGE INTO ... USING (SELECT ... FROM SYSIBM.SYSDUMMY1) ...for Merge/MergeAll, a genuine multi-rowVALUES (...), (...)list for batched InsertAll,TRUNCATE TABLE ... IMMEDIATE, and identity/primary-key retrieval viaSELECT ... FROM FINAL TABLE (INSERT ...)for Insert/InsertAll plus a follow-up same-command-textSELECTfor Merge/MergeAll (Db2 LUW’sMERGEhas noFINAL TABLEsupport). - Db2DbHelper — schema/type discovery (
GetFields/GetFieldsAsync) sourced fromSYSCAT.COLUMNS, and generated-identity retrieval (GetScopeIdentity/GetScopeIdentityAsync) viaIDENTITY_VAL_LOCAL()against Db2’s single-row dummy tableSYSIBM.SYSDUMMY1. - Resolvers — Db2ConvertFieldResolver (casts a field to its Db2 type when a conversion is needed, e.g. typed ExecuteQuery results), Db2DbTypeNameToClientTypeResolver (maps
SYSCAT.COLUMNS.TYPENAMEvalues to .NET CLR types), and DbTypeToDb2StringNameResolver (mapsSystem.Data.DbTypeto Db2 SQL type names, e.g.DbType.Guid→CHAR(16) FOR BIT DATA). - Property handlers — Db2GuidToByteArrayPropertyHandler (maps a
Guidproperty to/fromCHAR(16) FOR BIT DATA, since Db2 has no native GUID type) and Db2ByteToInt16PropertyHandler (maps abyteproperty to/fromSMALLINT, since Db2 has no native single-byte integer type). - Parameter attributes mirroring
DB2Parametermembers, settable per entity property: Db2Type, Db2TypeOutput, ArrayLength, IsDefault, IsUnassigned, SourceColumn, SourceColumnNullMapping, and SourceVersion. - QueryMultiple/
QueryMultipleAsyncrun as a single combined, multi-statement command text ("SELECT ... T1; SELECT ... T2") — no per-type round trip.
Known limitations (v1)
- Every statement binds parameters using
:Name-style host variables. IBM’s Data Server .NET Provider disables host-variable support by default, so the connection string must includeHostVarParameters=True;, otherwise every parameterized call fails withDB2ExceptionSQL0313N. - InsertAll/MergeAll/UpdateAll batch multiple entities into a single round trip, but InsertAll’s row-to-identity correlation relies on an assumption not yet verified against a live Db2 instance: that
FINAL TABLE’s result rows preserve the sourceVALUESlist order. Verify thoroughly before relying on it in production. - MergeAll throws
NotSupportedExceptionfor abatchSizegreater than 1 when the identity column is used as a qualifier, since a freshly-inserted row’s caller-bound qualifier value can’t be safely re-correlated within a mixed matched/unmatched batch. Pass an explicit non-identity qualifier, or call withbatchSize: 1. - Merge’s generated-key retrieval falls back to re-reading
MAX(<key>)off the table rather thanIDENTITY_VAL_LOCAL(), since Db2 LUW’s per-statement autocommit clears that register before the follow-upSELECTruns — a best-effort read, not a guarantee, if another connection concurrently inserts into the same table. - Merge/MergeAll against tables with several LOB columns can fail with
SQL1585N(system temporary tablespace too small); provisioning a 32K-page temporary tablespace works around it. XML-mapped fields are not supported in Merge/MergeAll at all. - No native GUID/
UNIQUEIDENTIFIERtype — map aGuidproperty asbyte[], or register Db2GuidToByteArrayPropertyHandler per-property. - The published package only references the Windows driver package (
Net.IBM.Data.Db2) transitively. Linux, macOS, and other non-Windows consumers must add the matchingNet.IBM.Data.Db2-*package themselves — see Get Started for Db2. -
Db2 for z/OS and Db2 for i are not currently tested against — only Db2 LUW 10.5 and later.
- Referenced the
RepoDbpackagev1.16.0. - Referenced the
Net.IBM.Data.Db2/Net.IBM.Data.Db2-lnxpackagev9.0.0.400(v10.0.0.200on .NET 10).