Releases for RepoDb.SapHana
View the NuGet package here or download it directly here.
RepoDb.SapHana (v0.0.1-alpha) - Preview
Released: TBA
New
First (alpha) release of the SAP HANA provider for RepoDB, built on top of Sap.Data.Hana.Net.v6.0. Targets .NET 8, .NET 9, and .NET 10.
Verification status: implemented and reviewed, but not yet exercised against a live SAP HANA instance. Verify the identity read-back and
UPSERT ... WITH PRIMARY KEYsemantics before relying on this package in production.
What’s included
- SapHanaBootstrap / SapHanaConfiguration
.UseSapHana()— initializes RepoDB for use withHanaConnection(GlobalConfiguration.Setup().UseSapHana()), mapping the SapHanaDbSetting, SapHanaDbHelper, and SapHanaStatementBuilder to everyHanaConnection. - SapHanaDbSetting —
"identifier quotes,:parameter prefix, no table hints, no multi-statement command text support (IsMultiStatementExecutable = false, since SAP HANA’s ADO.NET client rejects a command text containing more than one SQL statement). - SapHanaStatementBuilder — generates SAP HANA-flavored SQL: ANSI
LIMIT/LIMIT ... OFFSETpaging for Query/BatchQuery/skip-take queries, a nativeUPSERT ... WITH PRIMARY KEYfor Merge/MergeAll, andCOUNT(/MAX(/MIN(/SUM(reformatted (no space before the parenthesis). - SapHanaDbHelper — schema/type discovery (
GetFields/GetFieldsAsync) sourced fromSYS.TABLE_COLUMNS/SYS.CONSTRAINTS, scoped toCURRENT_SCHEMA.GetScopeIdentity/GetScopeIdentityAsyncrunSELECT CURRENT_IDENTITY_VALUE() FROM DUMMY;. - Resolvers — SapHanaDbTypeNameToClientTypeResolver (maps
SYS.TABLE_COLUMNS.DATA_TYPE_NAMEvalues to .NET CLR types) and SapHanaDbTypeToStringNameResolver (mapsSap.Data.Hana.HanaDbTypeto SAP HANA SQL type names). The SapHanaDbType parameter attribute, mirroring
HanaParameter.HanaDbType, settable per entity property.- Referenced the
RepoDbpackagev1.16.0. - Referenced the
Sap.Data.Hana.Net.v6.0packagev2.29.25.
Known limitations (v1)
- InsertAll, MergeAll and UpdateAll issue one round trip per row, since
IsMultiStatementExecutableisfalse. Passing an explicitbatchSizegreater than1throws aNotSupportedException. UseBulkInsert/BulkMerge/BulkUpdatefrom RepoDb.SapHana.BulkOperations instead. - No table hints of any kind —
AreTableHintsSupportedisfalse; passing a non-nullhintsargument throws aNotSupportedException. - No
ConvertFieldResolver/property-handler classes of its own — SapHanaStatementBuilder is constructed withnullfor bothconvertFieldResolverandaverageableClientTypeResolver, falling back to BaseStatementBuilder’s defaults. TypedCAST(...)generation and average-widening behavior have not been tuned for SAP HANA’s numeric-type semantics. - No native GUID/UNIQUEIDENTIFIER type, and the core package ships no bundled Guid-mapping property handler.
SapHanaGuidToStringPropertyHandler(maps aGuidproperty to/from anNVARCHAR(36)column) lives in RepoDb.SapHana.BulkOperations instead — install that package (even without using itsBulk*operations) if you need it, or write your ownIPropertyHandler<string, Guid>. - Merge compiles to
UPSERT ... WITH PRIMARY KEY, which matches against the primary key — its value must already be known on the entity being merged. There is no path to auto-generate and return an identity value within the same call. GetScopeIdentity/GetScopeIdentityAsync’sSELECT CURRENT_IDENTITY_VALUE() FROM DUMMY;query has not been verified against a live instance.- Only a standard SAP HANA server (verified conceptually against HANA Express/HXE) is targeted.