Expand description
Synchronous native rust database driver for SAP HANA (TM).
hdbconnect
provides a lean, fast, and easy-to-use rust-API for working with
SAP HANA. The driver is written completely in rust.
It 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
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 - Code examples.
- time
- Support for serializing from or deserializing into types of the
time
crate. - types
- Non-standard types that are used to represent database values.
- url
- Constants for use in connection URLs.
Structs§
- Connect
Params - An immutable struct with all information necessary to open a new connection to a HANA database.
- Connect
Params Builder - A builder for
ConnectParams
. - Connection
- A synchronous connection to the database.
- Connection
Configuration - A collection of settings that influence the runtime behavior of a connection.
- Connection
Manager r2d2_pool
- Implementation of r2d2’s
ManageConnection
. - Connection
Statistics - Provides some statistics about the use of a concrete connection.
- Field
Metadata - Metadata of a field in a
ResultSet
. - HdbResponse
- Represents all possible non-error responses to a database command.
- Output
Parameters - A set of output parameters, as they can be returned by procedure calls.
- Parameter
Descriptor - Metadata for a parameter.
- Parameter
Descriptors - Describes a set of IN, INOUT, and OUT parameters. Can be empty.
- Prepared
Statement - Allows injection-safe SQL execution and repeated calls of the same statement with different parameters with as few roundtrips as possible.
- Result
Set - The result of a database query.
- Result
SetMetadata - List of metadata of the fields of a resultset.
- Row
- A single line of a
ResultSet
, consisting of the containedHdbValue
s and a reference to the metadata. - Server
Error - Describes an error that is reported from the database.
- Server
Usage - Describes the server-side resource consumption.
Enums§
- Cursor
Holdability - Holdability of cursors in the database.
- Deserialization
Error - The errors that can arise while deserializing with
serde_db::de
. - Execution
Result - Describes the success of a command.
- HdbError
- A list specifying categories of
HdbError
. - HdbReturn
Value - An enum that describes a single database return value.
- HdbValue
- Enum for all supported database value types.
- Parameter
Binding - Describes whether a parameter is Nullable or not or if it has a default value.
- Parameter
Direction - Describes whether a parameter is used for input, output, or both.
- Serialization
Error - Error that can occur while serializing a standard rust type or struct into a SQL parameter.
- Server
Certs - Expresses where Certificates for TLS are read from.
- Severity
- Severity of a server message
- TypeId
- ID of the value type of a database column or a parameter.
Traits§
- Into
Connect Params - A trait implemented by types that can be converted into a
ConnectParams
. - Into
Connect Params Builder - A trait implemented by types that can be converted into a
ConnectParamsBuilder
. - ToHana
- Helper trait for serialization.
Type Aliases§
- HdbResult
- Abbreviation of
Result<T, HdbError>
.