Link Search Menu Expand Document

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 KEY semantics before relying on this package in production.

What’s included

  • SapHanaBootstrap / SapHanaConfiguration.UseSapHana() — initializes RepoDB for use with HanaConnection (GlobalConfiguration.Setup().UseSapHana()), mapping the SapHanaDbSetting, SapHanaDbHelper, and SapHanaStatementBuilder to every HanaConnection.
  • 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 ... OFFSET paging for Query/BatchQuery/skip-take queries, a native UPSERT ... WITH PRIMARY KEY for Merge/MergeAll, and COUNT(/MAX(/MIN(/SUM( reformatted (no space before the parenthesis).
  • SapHanaDbHelper — schema/type discovery (GetFields/GetFieldsAsync) sourced from SYS.TABLE_COLUMNS/SYS.CONSTRAINTS, scoped to CURRENT_SCHEMA. GetScopeIdentity/GetScopeIdentityAsync run SELECT CURRENT_IDENTITY_VALUE() FROM DUMMY;.
  • Resolvers — SapHanaDbTypeNameToClientTypeResolver (maps SYS.TABLE_COLUMNS.DATA_TYPE_NAME values to .NET CLR types) and SapHanaDbTypeToStringNameResolver (maps Sap.Data.Hana.HanaDbType to SAP HANA SQL type names).
  • The SapHanaDbType parameter attribute, mirroring HanaParameter.HanaDbType, settable per entity property.

  • Referenced the RepoDb package v1.16.0.
  • Referenced the Sap.Data.Hana.Net.v6.0 package v2.29.25.

Known limitations (v1)

  • InsertAll, MergeAll and UpdateAll issue one round trip per row, since IsMultiStatementExecutable is false. Passing an explicit batchSize greater than 1 throws a NotSupportedException. Use BulkInsert/BulkMerge/BulkUpdate from RepoDb.SapHana.BulkOperations instead.
  • No table hints of any kind — AreTableHintsSupported is false; passing a non-null hints argument throws a NotSupportedException.
  • No ConvertFieldResolver/property-handler classes of its own — SapHanaStatementBuilder is constructed with null for both convertFieldResolver and averageableClientTypeResolver, falling back to BaseStatementBuilder’s defaults. Typed CAST(...) 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 a Guid property to/from an NVARCHAR(36) column) lives in RepoDb.SapHana.BulkOperations instead — install that package (even without using its Bulk* operations) if you need it, or write your own IPropertyHandler<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’s SELECT 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.