Preview Support for SAP HANA is Now Available in RepoDB
We are excited to announce the preview release of SAP HANA support for RepoDB — bringing our hybrid ORM’s fluent CRUD, raw-SQL, and Bulk Operations capabilities to SAP HANA for the first time, right out of the gate.
What’s in this preview?
The new RepoDb.SapHana package brings the full RepoDB experience to SAP HANA, built on top of Sap.Data.Hana.Net.v6.0:
- Full CRUD operations — Insert, Query, Update, Delete, and Merge
- Raw-SQL operations — ExecuteQuery, ExecuteNonQuery, ExecuteScalar, and ExecuteReader, for when you need full control over the statement being sent to the server
- Bulk operations, via
RepoDb.SapHana.BulkOperations— BulkInsert, BulkUpdate, BulkDelete, BulkDeleteByKey, and BulkMerge
It follows the same programming model you already use with our SQL Server, PostgreSQL, MySQL, SQLite, Oracle, DB2, MariaDB, Firebird, and Vertica extensions — the same fluent API, the same lightweight philosophy, now targeting SAP HANA.
Why SAP HANA?
SAP HANA is the in-memory, columnar database at the core of a large share of enterprise SAP landscapes — S/4HANA, BW/4HANA, and countless custom-built systems around them. Teams working alongside those systems have long had to reach for heavier tooling just to get a fast, ADO.NET-native data-access layer. This preview brings the same lightweight, hybrid CRUD-plus-raw-SQL experience RepoDB is known for to that world.
Getting started
Install the packages:
> Install-Package RepoDb.SapHana -Version 0.0.1-alpha
> Install-Package RepoDb.SapHana.BulkOperations -Version 0.0.1-alpha
Initialize it once at startup:
GlobalConfiguration
.Setup()
.UseSapHana();
Basic CRUD
Insert
using var connection = new HanaConnection(connectionString);
var person = new Person { Name = "John Doe", Age = 30, CreatedDateUtc = DateTime.UtcNow };
var id = connection.Insert(person);
Query
using var connection = new HanaConnection(connectionString);
var person = connection.Query<Person>(e => e.Id == 10045).FirstOrDefault();
Update
using var connection = new HanaConnection(connectionString);
var person = connection.Query<Person>(e => e.Id == 10045).FirstOrDefault();
person.Age = 31;
var updatedRows = connection.Update(person);
Delete
using var connection = new HanaConnection(connectionString);
var deletedRows = connection.Delete<Person>(10045);
Merge
using var connection = new HanaConnection(connectionString);
// Id must already be known — Merge matches on the primary key
var person = new Person { Id = 10045, Name = "John Doe", Age = 32, CreatedDateUtc = DateTime.UtcNow };
var id = connection.Merge(person);
Raw-SQL
ExecuteQuery
using var connection = new HanaConnection(connectionString);
var people = connection.ExecuteQuery<Person>("SELECT * FROM \"Person\" ORDER BY \"Id\" ASC");
ExecuteNonQuery
using var connection = new HanaConnection(connectionString);
var affectedRows = connection.ExecuteNonQuery("DELETE FROM \"Person\" WHERE \"Id\" = :Id",
new { Id = 10045 });
ExecuteScalar
using var connection = new HanaConnection(connectionString);
var maxId = connection.ExecuteScalar<long>("SELECT MAX(\"Id\") FROM \"Person\"");
Bulk Operations
BulkInsert
using var connection = new HanaConnection(connectionString);
// Writes straight into the target table
var people = GetPeopleToInsert();
var insertedRows = connection.BulkInsert(people);
BulkMerge
using var connection = new HanaConnection(connectionString);
// A real, single-statement ANSI MERGE via a staging table
var people = GetPeopleToMerge();
var mergedRows = connection.BulkMerge(people, qualifiers: e => e.Id);
BulkDeleteByKey
using var connection = new HanaConnection(connectionString);
// Takes the target table name directly
var keys = new long[] { 10045, 10046, 10047 };
var deletedRows = connection.BulkDeleteByKey<long>("Person", keys);
A preview, not a final release
As a preview package at v0.0.1-alpha, RepoDb.SapHana (and its Bulk Operations counterpart) is still maturing — APIs and behavior, including the caveats described above, may change before a stable release ships. Importantly, this release has been implemented and reviewed but not yet exercised against a live SAP HANA instance — in particular, verify the identity read-back, the UPSERT ... WITH PRIMARY KEY semantics, and the bulk pseudo-table lifecycle end-to-end before relying on this package in production. We would love to hear your feedback as you try it out; it directly shapes what we prioritize on the way to general availability.
~ Conceptualized by me. Reviewed and checked by AI. Refined and gatekept by me. ~
Please support us
Give a ⭐ to our Github repository |
Follow me at X / Twitter |
Connect with us at our official Teams Channel
Apache License 2.0 — Copyright © 2026 by Michael Camara Pendon / Create a Request