Crate hdbconnect_async

Source
Expand description

Asynchronous database driver for SAP HANA (TM).

hdbconnect_async is written completely in rust, its asynchronous model is based on tokio. It provides a lean, fast, and easy-to-use API for working with SAP HANA.

For usecases where you don’t need an asynchronous driver, you might want to use hdbconnect_async’s synchronous sibling, hdbconnect. The two drivers have a very similar API and share most of their implementation.

hdbconnect_async interoperates elegantly with all data types that implement the standard serde::Serialize and/or serde::Deserialize traits, for input and output respectively. So, instead of iterating over a result set by rows and columns, you can assign the complete result set directly to any rust structure that fits the data semantics.

hdbconnect_async implements this with the help of serde_db, a reusable library for simplifying the data exchange between application code and database drivers, both for input parameters (e.g. to prepared statements) and for results that are returned from the database.

In contrast to typical ORM mapping variants, this approach allows using the full flexibility of SQL (projection lists, all kinds of joins, unions, nested queries, etc). Whatever query you need, you just use it, without further ado for defining object models etc., and whatever result structure you want to read, you just use a corresponding rust structure into which you deserialize the data. It’s hard to use less code!

See code examples for an overview.

Modules§

  • Code examples.
  • Support for serializing from or deserializing into types of the time crate.
  • Non-standard types that are used to represent database values.
  • Constants for use in connection URLs.

Structs§

Enums§

Traits§

Functions§

  • Call this once early in your application to ensure a correct initialization of rustls, the TLS library being used.

Type Aliases§

  • Abbreviation of Result<T, HdbError>.