RepoDb.SapHana
A hybrid .NET ORM library for SAP HANA (using Sap.Data.Hana).
Install
| Product | Versions |
|---|---|
| .NET |
README
RepoDb.SapHana β RepoDB for SAP HANA
The SAP HANA provider for RepoDB β a fast, lightweight .NET ORM that lets you use raw SQL and fluent operations side by side on the same connection. Built on top of RepoDb and the Sap.Data.Hana.Net.v6.0 ADO.NET driver.
This provider has not been verified against a live SAP HANA instance. See the code comments in this project for the specific assumptions made (parameter prefix, driver type names, etc.) and verify them before relying on this in production.
Important Pages
- GitHub Home β core library and source code.
- Website β full documentation, API reference, and blog.
Community
- GitHub Issues β bug reports and feature requests.
- Microsoft Teams β live Q&A.
- GitHub Discussions β ask questions and share ideas.
- X / Twitter β news and updates.
Dependencies
- Sap.Data.Hana.Net.v6.0 β the SAP HANA ADO.NET data provider.
- RepoDb β the RepoDB core library.
License
Apache-2.0 β Copyright Β© 2020 Michael Camara Pendon
Installation
Install-Package RepoDb.SapHana
Or visit the installation page for more options.
Get Started
Initialize the bootstrapper once at application startup:
GlobalConfiguration
.Setup()
.UseSapHana();
Then use any RepoDB operation directly on your HanaConnection:
Query
using (var connection = new HanaConnection(ConnectionString))
{
var customer = connection.Query<Customer>(c => c.Id == 10045);
}
Insert
var customer = new Customer
{
FirstName = "John",
LastName = "Doe",
IsActive = true
};
using (var connection = new HanaConnection(ConnectionString))
{
var id = connection.Insert<Customer>(customer);
}
Update
using (var connection = new HanaConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
customer.FirstName = "John";
customer.LastUpdatedUtc = DateTime.UtcNow;
var affectedRows = connection.Update<Customer>(customer);
}
Delete
using (var connection = new HanaConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
var deletedCount = connection.Delete<Customer>(customer);
}
ExecuteQuery
using (var connection = new HanaConnection(ConnectionString))
{
var customer = connection.ExecuteQuery<Customer>("SELECT * FROM \"Customer\" WHERE (Id = :Id);", new { Id = 10045 }).FirstOrDefault();
}
ExecuteNonQuery
using (var connection = new HanaConnection(ConnectionString))
{
var affectedRows = connection.ExecuteNonQuery("UPDATE \"Customer\" SET FirstName = :FirstName WHERE (Id = :Id);", new { FirstName = "John", Id = 10045 });
}
ExecuteScalar
using (var connection = new HanaConnection(ConnectionString))
{
var count = connection.ExecuteScalar<int>("SELECT COUNT(*) FROM \"Customer\";");
}
Visit the get-started page for the full SAP HANA guide.
License
Apache-2.0 β Copyright Β© 2019 Michael Camara Pendon
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.